Documentation ¶
Index ¶
- Constants
- func AddCommand(key string, callback CommandCallback, tag string, alttags []string)
- func GetCommandsLength() int
- func LogFatal(text string, owner string, errorcode int)
- func SanitizeArgs(slice []string) []string
- func SliceToHumanListing(slices []string) string
- func SliceToString(slices []string) string
- func StringToInt64(inp string) (int64, error)
- func StringToSlice(text string) (slices []string)
- type Command
- type CommandArgs
- func (c CommandArgs) GetChannelMention(ID string) string
- func (c CommandArgs) GetGuild() *discordgo.Guild
- func (c CommandArgs) GetMe() *discordgo.User
- func (c CommandArgs) GetUserMention(ID string) string
- func (c CommandArgs) SendEmbed(embed *discordgo.MessageEmbed) *discordgo.Message
- func (c CommandArgs) SendFile(name, file string) error
- func (c CommandArgs) SendMessage(text string) *discordgo.Message
- func (c CommandArgs) SendMessageFormatted(text string)
- func (c CommandArgs) SendTyping()
- func (c CommandArgs) SetGame(game string)
- type CommandCallback
- type DataRecieve
- type LogText
- type Vendor
Constants ¶
const (
TERM = -1
)
Variables ¶
This section is empty.
Functions ¶
func AddCommand ¶
func AddCommand(key string, callback CommandCallback, tag string, alttags []string)
AddCommand adds a command to Commands.
func GetCommandsLength ¶
func GetCommandsLength() int
func SanitizeArgs ¶
SanitizeArgs Sanitizes the arguments of a slice, by combining indexes which are in quotes.
func SliceToHumanListing ¶
SliceToHumanListing converts a slice into a human listing of objects, eg. "Cat, dog and bird"
func SliceToString ¶
SliceToString turns a slice of strings into a single string with space denotation.
func StringToInt64 ¶
func StringToSlice ¶
StringToSlice turns a string into slices based of space character denotation..
Types ¶
type Command ¶
type Command struct { Callback CommandCallback CommandTag string AlternateTags []string }
Command is a command.
func GetCommand ¶
GetCommand gets an command via its name.
func GetCommandByTag ¶
GetCommandByTag gets an command by its tag.
type CommandArgs ¶
type CommandArgs struct { Session *discordgo.Session Event *discordgo.MessageCreate UsedTag string }
CommandArgs is arguments for the command provided by discordgo
func (CommandArgs) GetChannelMention ¶
func (c CommandArgs) GetChannelMention(ID string) string
func (CommandArgs) GetGuild ¶
func (c CommandArgs) GetGuild() *discordgo.Guild
func (CommandArgs) GetMe ¶
func (c CommandArgs) GetMe() *discordgo.User
func (CommandArgs) GetUserMention ¶
func (c CommandArgs) GetUserMention(ID string) string
func (CommandArgs) SendEmbed ¶
func (c CommandArgs) SendEmbed(embed *discordgo.MessageEmbed) *discordgo.Message
func (CommandArgs) SendFile ¶
func (c CommandArgs) SendFile(name, file string) error
func (CommandArgs) SendMessage ¶
func (c CommandArgs) SendMessage(text string) *discordgo.Message
func (CommandArgs) SendMessageFormatted ¶
func (c CommandArgs) SendMessageFormatted(text string)
func (CommandArgs) SendTyping ¶
func (c CommandArgs) SendTyping()
func (CommandArgs) SetGame ¶
func (c CommandArgs) SetGame(game string)
type CommandCallback ¶
type CommandCallback func(dargs CommandArgs, args []string) (success bool)
CommandCallback is a function or something
type DataRecieve ¶
type DataRecieve struct { EventType int // from const A interface{} }
type LogText ¶
LogText contains the different types of text in a log.
func LogWarning ¶
LogWarning logs warning level Info.