Documentation
¶
Index ¶
- func AboutCommand(ctx CommandContext, args []string) error
- func HelpCommand(ctx CommandContext, args []string) error
- func LoadTags(f string, log *logrus.Logger)
- func OwnerCommand(ctx CommandContext, args []string) error
- func PingCommand(ctx CommandContext, args []string) error
- func TagCommand(ctx CommandContext, args []string) error
- type Command
- type CommandContext
- type CommandFunc
- type CommandManager
- func (cmdm *CommandManager) AddCommand(cmd *Command)
- func (cmdm *CommandManager) AddNewCommand(name, desc string, owneronly, hidden bool, ...)
- func (cmdm *CommandManager) AddPrefix(prefix string)
- func (cmdm *CommandManager) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)
- func (cmdm *CommandManager) GetPrefixes() []string
- func (cmdm *CommandManager) IsOwner(id string) bool
- func (cmdm *CommandManager) RemoveCommand(name string)
- func (cmdm *CommandManager) RemovePrefix(prefix string)
- func (cmdm *CommandManager) SetPrefixes(prefixes []string)
- type CommandManagerOnErrorFunc
- type CommandType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AboutCommand ¶
func AboutCommand(ctx CommandContext, args []string) error
func HelpCommand ¶
func HelpCommand(ctx CommandContext, args []string) error
func OwnerCommand ¶
func OwnerCommand(ctx CommandContext, args []string) error
func PingCommand ¶
func PingCommand(ctx CommandContext, args []string) error
func TagCommand ¶
func TagCommand(ctx CommandContext, args []string) error
Types ¶
type Command ¶
type Command struct { Name string Description string OwnerOnly bool Hidden bool UserPermissions Shared.Permission BotPermissions Shared.Permission Type CommandType Run CommandFunc }
func NewAboutCommand ¶
func NewAboutCommand() *Command
func NewHelpCommand ¶
func NewHelpCommand() *Command
func NewOwnerCommand ¶
func NewOwnerCommand() *Command
func NewPingCommand ¶
func NewPingCommand() *Command
func NewTagCommand ¶
func NewTagCommand() *Command
type CommandContext ¶
type CommandContext struct { Session *discordgo.Session Event *discordgo.MessageCreate Manager *CommandManager StatusManager *Status.StatusManager Message *discordgo.Message User *discordgo.User Channel *discordgo.Channel Guild *discordgo.Guild Member *discordgo.Member }
func (*CommandContext) Reply ¶
func (ctx *CommandContext) Reply(message string) (*discordgo.Message, error)
func (*CommandContext) ReplyEmbed ¶
func (ctx *CommandContext) ReplyEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error)
type CommandFunc ¶
type CommandFunc func(CommandContext, []string) error
type CommandManager ¶
type CommandManager struct { Prefixes []string Owners []string StatusManager *Status.StatusManager Logger *logrus.Logger Commands map[string]*Command IgnoreBots bool OnErrorFunc CommandManagerOnErrorFunc }
func NewCommandManager ¶
func NewCommandManager(c Configuration.Configuration, sm *Status.StatusManager, l *logrus.Logger, ignoreBots bool) CommandManager
func (*CommandManager) AddCommand ¶
func (cmdm *CommandManager) AddCommand(cmd *Command)
func (*CommandManager) AddNewCommand ¶
func (cmdm *CommandManager) AddNewCommand(name, desc string, owneronly, hidden bool, userperms, botperms Shared.Permission, cmdType CommandType, run CommandFunc)
func (*CommandManager) AddPrefix ¶
func (cmdm *CommandManager) AddPrefix(prefix string)
func (*CommandManager) CommandHandler ¶
func (cmdm *CommandManager) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)
func (*CommandManager) GetPrefixes ¶
func (cmdm *CommandManager) GetPrefixes() []string
func (*CommandManager) IsOwner ¶
func (cmdm *CommandManager) IsOwner(id string) bool
func (*CommandManager) RemoveCommand ¶
func (cmdm *CommandManager) RemoveCommand(name string)
func (*CommandManager) RemovePrefix ¶
func (cmdm *CommandManager) RemovePrefix(prefix string)
func (*CommandManager) SetPrefixes ¶
func (cmdm *CommandManager) SetPrefixes(prefixes []string)
type CommandManagerOnErrorFunc ¶
type CommandManagerOnErrorFunc func(cmdm *CommandManager, err error)
type CommandType ¶
type CommandType int
const ( CommandTypePM CommandType = iota CommandTypeGuild CommandTypeEverywhere )
Click to show internal directories.
Click to hide internal directories.