arguments

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2020 License: ISC Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmojiRegex = regexp.MustCompile(`<(a?):(.+?):(\d+)>`)

	ErrInvalidEmoji = errors.New("Invalid emoji")
)
View Source
var (
	ChannelRegex = regexp.MustCompile(`<#(\d+)>`)
	UserRegex    = regexp.MustCompile(`<@!?(\d+)>`)
	RoleRegex    = regexp.MustCompile(`<@&(\d+)>`)
)
View Source
var FlagName = "command"
View Source
var Regex = regexp.MustCompile(
	`https://(|ptb\.|canary\.)discordapp\.com/channels/(\d+)/(\d+)/(\d+)`,
)

(empty) so it matches standard links | OR canary. matches canary MessageURL 3 `(\d+)` for guild ID, channel ID and message ID

Functions

This section is empty.

Types

type ChannelMention

type ChannelMention discord.Snowflake

func (*ChannelMention) ID added in v0.0.9

func (*ChannelMention) Mention added in v0.0.11

func (m *ChannelMention) Mention() string

func (*ChannelMention) Parse

func (m *ChannelMention) Parse(arg string) error

func (*ChannelMention) Usage

func (m *ChannelMention) Usage() string

type Emoji

type Emoji struct {
	ID   discord.Snowflake
	Name string

	Custom   bool
	Animated bool
}

func (Emoji) APIString added in v0.0.11

func (e Emoji) APIString() string

func (*Emoji) Parse

func (e *Emoji) Parse(arg string) error

func (Emoji) String added in v0.0.11

func (e Emoji) String() string

func (Emoji) URL added in v0.0.11

func (e Emoji) URL() string

func (*Emoji) Usage added in v0.3.0

func (e *Emoji) Usage() string

type Flag

type Flag struct {
	// contains filtered or unexported fields
}

func (*Flag) Arg

func (f *Flag) Arg(n int) string

func (*Flag) Args

func (f *Flag) Args() []string

func (*Flag) Command added in v0.0.10

func (f *Flag) Command() string

func (*Flag) ParseContent

func (f *Flag) ParseContent(arguments []string) error

func (*Flag) String

func (f *Flag) String() string

func (*Flag) Usage

func (f *Flag) Usage() string

func (*Flag) With

func (f *Flag) With(fs *flag.FlagSet) error

type FlagSet

type FlagSet struct {
	*flag.FlagSet
}

func NewFlagSet

func NewFlagSet() *FlagSet

func (*FlagSet) Usage

func (fs *FlagSet) Usage() string

type MessageURL added in v0.3.0

type MessageURL struct {
	GuildID   discord.Snowflake
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
}

MessageURL contains info from a MessageURL

func ParseMessageURL added in v0.3.0

func ParseMessageURL(url string) *MessageURL

ParseMessageURL parses the MessageURL into a smartlink

func (*MessageURL) Parse added in v0.3.0

func (url *MessageURL) Parse(arg string) error

func (*MessageURL) Usage added in v0.3.0

func (url *MessageURL) Usage() string

type RoleMention

type RoleMention discord.Snowflake

func (*RoleMention) ID added in v0.0.9

func (m *RoleMention) ID() discord.Snowflake

func (*RoleMention) Mention added in v0.0.11

func (m *RoleMention) Mention() string

func (*RoleMention) Parse

func (m *RoleMention) Parse(arg string) error

func (*RoleMention) Usage

func (m *RoleMention) Usage() string

type UserMention

type UserMention discord.Snowflake

func (*UserMention) ID added in v0.0.9

func (m *UserMention) ID() discord.Snowflake

func (*UserMention) Mention added in v0.0.11

func (m *UserMention) Mention() string

func (*UserMention) Parse

func (m *UserMention) Parse(arg string) error

func (*UserMention) Usage

func (m *UserMention) Usage() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL