Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { Session DiscordSession Handler *handler.Handler // contains filtered or unexported fields }
The Bot struct holds all information needed to do any general work on the bot. It also contains a DropletManager struct to manage modules at a high level.
type Config ¶
type Config struct { Name string // contains filtered or unexported fields }
Config contains parsed information from a supplied YAML file. This file is provided via command line arguments.
func NewConfigFromFile ¶
NewConfigFromFile returns an initialized config from a given file path.
func NewConfigFromString ¶
NewConfigFromString creates a config from a string using a YAML parser.
type DST ¶
type DST struct {
ID int
}
DST stands for DiscordSessionTest. It has mocked methods that are used within the bot's functions. The 'id' int for each struct is used to identify the structs. Positive IDs, starting with 0, represent properly working mocks. Negative IDs, starting with -1, represent intentionally broken mocks.
func (*DST) AddHandler ¶
func (dst *DST) AddHandler(handler interface{}) func()
AddHandler mocks discordgo.Session.AddHandler()
func (*DST) ChannelMessageSend ¶
type DiscordSession ¶
type DiscordSession interface { AddHandler(handler interface{}) func() Open() (err error) ChannelMessageSend(channelID string, content string) (*discordgo.Message, error) User(userID string) (*discordgo.User, error) }
DiscordSession is an interface to specify discord session capability. It is implemented mostly for testing of the bot (so that mocks can be created for the discord session struct from bwmarrin's discordgo).