app

package
v0.0.0-...-4196059 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegionalF = "🇫"
)

Variables

Functions

func CommandErrorFunc

func CommandErrorFunc(mb *ModzBot, ctx api.CommandContext, err error)

func Run

func Run()

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) ReplyFile

func (c CommandContext) ReplyFile(filename string, file io.Reader) (*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 Logger

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

func NewLogger

func NewLogger(level api.LogLevel) *Logger

func (*Logger) Debug

func (l *Logger) Debug(i ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(s string, i ...interface{})

func (*Logger) Error

func (l *Logger) Error(i ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(s string, i ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(i ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(s string, i ...interface{})

func (*Logger) GetLevel

func (l *Logger) GetLevel() api.LogLevel

func (*Logger) Info

func (l *Logger) Info(i ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(s string, i ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(i ...interface{})

func (*Logger) Panicf

func (l *Logger) Panicf(s string, i ...interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(level api.LogLevel)

func (*Logger) Trace

func (l *Logger) Trace(i ...interface{})

func (*Logger) Tracef

func (l *Logger) Tracef(s string, i ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(i ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(s string, i ...interface{})

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) AddPrefix

func (mb *ModzBot) AddPrefix(prefix string)

func (*ModzBot) GetCommand

func (mb *ModzBot) GetCommand(name string) (cmd api.Command, exists bool, index int)

func (*ModzBot) GetLogger

func (mb *ModzBot) GetLogger() api.Log

func (*ModzBot) GetPrefixes

func (mb *ModzBot) GetPrefixes() []string

func (*ModzBot) GetSession

func (mb *ModzBot) GetSession() *discordgo.Session

func (*ModzBot) HandleCommand

func (mb *ModzBot) HandleCommand(s *discordgo.Session, m *discordgo.MessageCreate)

func (*ModzBot) IsOwner

func (mb *ModzBot) IsOwner(id string) bool

func (*ModzBot) LoadModules

func (mb *ModzBot) LoadModules() error

func (*ModzBot) Modz

func (mb *ModzBot) Modz() *[]*api.Mod

func (*ModzBot) RegisterCommand

func (mb *ModzBot) RegisterCommand(cmd api.Command)

func (*ModzBot) RegisterModule

func (mb *ModzBot) RegisterModule(mod api.Mod) error

func (*ModzBot) RemovePrefix

func (mb *ModzBot) RemovePrefix(prefix string)

func (*ModzBot) SetPrefixes

func (mb *ModzBot) SetPrefixes(prefixes []string)

func (*ModzBot) UnloadModules

func (mb *ModzBot) UnloadModules()

func (*ModzBot) UnregisterCommand

func (mb *ModzBot) UnregisterCommand(name string)

type ModzBotOnErrorFunc

type ModzBotOnErrorFunc func(mb *ModzBot, ctx api.CommandContext, err error)

Jump to

Keyboard shortcuts

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