Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MongoConnectionTime the time in seconds that the // bot has to connect to the mongo database before // timeingout. MongoConnectionTime = 10 // MongoQueryTimeout the time in seconds that the // mongo database has to perform a query before it // times out. MongoQueryTimeout = 2 // MongoPingTime is the time the mongo database has // to respond to a ping before MongoPingTime = 2 // PingInterval is the time between each ping to check // that the Bot is still connected to the mongodb. PingInterval = 20 )
Variables ¶
This section is empty.
Functions ¶
func RemoveIndex ¶
RemoveIndex is just a general function which removes an item from a slice given an index.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot handels all of the incoming messages for the bot and stores all of the information for each of the discord servers
func (*Bot) MonitorMongoConnection ¶
MonitorMongoConnection constantly pings the mongo database to ensure the Bot is till connected.
func (*Bot) Setup ¶
Setup creates a new session with the token set when the bot was created. Setup returns an error if the Bot could not connect to the discord API.
type DiscordServer ¶
type DiscordServer struct { // guildID is the unique ID given to a discord // server GuildID string `bson:"guildID"` // lists stores a collection of items assigned // to a list id. Lists map[string][]string `bson:"lists"` }
DiscordServer has all of the functions that the not can perform for a server.
func NewDiscordServer ¶
func NewDiscordServer(guildID string) *DiscordServer
NewDiscordServer returns a pointer to a DiscordServer instance.
Click to show internal directories.
Click to hide internal directories.