Documentation
¶
Index ¶
- Constants
- Variables
- func CommandErrorFunc(mb *ModzBot, ctx api.CommandContext, err error)
- func Run()
- type CommandContext
- func (c CommandContext) Channel() *discordgo.Channel
- func (c CommandContext) Client() api.ClientWrapper
- func (c CommandContext) Guild() *discordgo.Guild
- func (c CommandContext) Member() *discordgo.Member
- func (c CommandContext) Message() *discordgo.Message
- func (c CommandContext) PurgeMessages(num int) error
- func (c CommandContext) Reply(message string) (*discordgo.Message, error)
- func (c CommandContext) ReplyEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error)
- func (c CommandContext) ReplyEmbedBuilder(builder api.EmbedBuilder) (*discordgo.Message, error)
- func (c CommandContext) ReplyFile(filename string, file io.Reader) (*discordgo.Message, error)
- func (c CommandContext) ReplyTTS(message string) (*discordgo.Message, error)
- func (c CommandContext) User() *discordgo.User
- type Configuration
- type Logger
- func (l *Logger) Debug(i ...interface{})
- func (l *Logger) Debugf(s string, i ...interface{})
- func (l *Logger) Error(i ...interface{})
- func (l *Logger) Errorf(s string, i ...interface{})
- func (l *Logger) Fatal(i ...interface{})
- func (l *Logger) Fatalf(s string, i ...interface{})
- func (l *Logger) GetLevel() api.LogLevel
- func (l *Logger) Info(i ...interface{})
- func (l *Logger) Infof(s string, i ...interface{})
- func (l *Logger) Panic(i ...interface{})
- func (l *Logger) Panicf(s string, i ...interface{})
- func (l *Logger) SetLevel(level api.LogLevel)
- func (l *Logger) Trace(i ...interface{})
- func (l *Logger) Tracef(s string, i ...interface{})
- func (l *Logger) Warn(i ...interface{})
- func (l *Logger) Warnf(s string, i ...interface{})
- type ModuleContext
- type ModzBot
- func (mb *ModzBot) AddPrefix(prefix string)
- func (mb *ModzBot) GetCommand(name string) (cmd api.Command, exists bool, index int)
- func (mb *ModzBot) GetLogger() api.Log
- func (mb *ModzBot) GetPrefixes() []string
- func (mb *ModzBot) GetSession() *discordgo.Session
- func (mb *ModzBot) HandleCommand(s *discordgo.Session, m *discordgo.MessageCreate)
- func (mb *ModzBot) IsOwner(id string) bool
- func (mb *ModzBot) LoadModules() error
- func (mb *ModzBot) Modz() *[]*api.Mod
- func (mb *ModzBot) RegisterCommand(cmd api.Command)
- func (mb *ModzBot) RegisterModule(mod api.Mod) error
- func (mb *ModzBot) RemovePrefix(prefix string)
- func (mb *ModzBot) SetPrefixes(prefixes []string)
- func (mb *ModzBot) UnloadModules()
- func (mb *ModzBot) UnregisterCommand(name string)
- type ModzBotOnErrorFunc
Constants ¶
View Source
const (
RegionalF = "🇫"
)
Variables ¶
View Source
var Log = NewLogger(api.LogLevelDebug)
Functions ¶
func CommandErrorFunc ¶
func CommandErrorFunc(mb *ModzBot, ctx api.CommandContext, err error)
Types ¶
type CommandContext ¶
type CommandContext struct {
// contains filtered or unexported fields
}
func (CommandContext) Channel ¶
func (c CommandContext) Channel() *discordgo.Channel
func (CommandContext) Client ¶
func (c CommandContext) Client() api.ClientWrapper
func (CommandContext) Guild ¶
func (c CommandContext) Guild() *discordgo.Guild
func (CommandContext) Member ¶
func (c CommandContext) Member() *discordgo.Member
func (CommandContext) Message ¶
func (c CommandContext) Message() *discordgo.Message
func (CommandContext) PurgeMessages ¶
func (c CommandContext) PurgeMessages(num int) error
PurgeMessages purges 'x' number of messages from the Channel a CommandContext was initiated for.
func (CommandContext) Reply ¶
func (c CommandContext) Reply(message string) (*discordgo.Message, error)
func (CommandContext) ReplyEmbed ¶
func (c CommandContext) ReplyEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error)
func (CommandContext) ReplyEmbedBuilder ¶
func (c CommandContext) ReplyEmbedBuilder(builder api.EmbedBuilder) (*discordgo.Message, error)
func (CommandContext) ReplyTTS ¶
func (c CommandContext) ReplyTTS(message string) (*discordgo.Message, error)
func (CommandContext) User ¶
func (c CommandContext) User() *discordgo.User
type Configuration ¶
type Configuration struct {
Token string `json:"token"`
Prefixes []string `json:"prefixes"`
Owners []string `json:"owners"`
}
var Config Configuration
func LoadConfiguration ¶
func LoadConfiguration(file string, log api.Log) Configuration
type ModuleContext ¶
type ModuleContext struct {
// contains filtered or unexported fields
}
func (ModuleContext) Client ¶
func (m ModuleContext) Client() api.ClientWrapper
func (ModuleContext) Logger ¶
func (m ModuleContext) Logger() api.Log
type ModzBot ¶
type ModzBot struct {
Session *discordgo.Session
Prefixes []string
Owners []string
Logger api.Log
Modules *[]*api.Mod
Commands *[]*api.Command
IgnoreBots bool
OnErrorFunc ModzBotOnErrorFunc
// contains filtered or unexported fields
}
func NewModzBot ¶
func NewModzBot(session *discordgo.Session, c Configuration, log api.Log, ignoreBots bool, errorFunc ModzBotOnErrorFunc) ModzBot
func (*ModzBot) GetCommand ¶
func (*ModzBot) GetPrefixes ¶
func (*ModzBot) GetSession ¶
func (*ModzBot) HandleCommand ¶
func (mb *ModzBot) HandleCommand(s *discordgo.Session, m *discordgo.MessageCreate)
func (*ModzBot) LoadModules ¶
func (*ModzBot) RegisterCommand ¶
func (*ModzBot) RemovePrefix ¶
func (*ModzBot) SetPrefixes ¶
func (*ModzBot) UnloadModules ¶
func (mb *ModzBot) UnloadModules()
func (*ModzBot) UnregisterCommand ¶
type ModzBotOnErrorFunc ¶
type ModzBotOnErrorFunc func(mb *ModzBot, ctx api.CommandContext, err error)
Click to show internal directories.
Click to hide internal directories.