add a method to set gateway status
This commit is contained in:
parent
014e974499
commit
f829a3263e
14
core.go
14
core.go
|
|
@ -33,6 +33,9 @@ var Session *discordgo.Session
|
||||||
// This is a boolean map, because checking its values is dead simple this way
|
// This is a boolean map, because checking its values is dead simple this way
|
||||||
var botAdmins = make(map[string]bool)
|
var botAdmins = make(map[string]bool)
|
||||||
|
|
||||||
|
// BotPresence
|
||||||
|
var botPresence discordgo.GatewayStatusUpdate
|
||||||
|
|
||||||
// BotToken
|
// BotToken
|
||||||
// A string of the current bot token, usually set by the main method
|
// A string of the current bot token, usually set by the main method
|
||||||
// Similar to BotAdmins, this isn't saved to .json and is added programmatically
|
// Similar to BotAdmins, this isn't saved to .json and is added programmatically
|
||||||
|
|
@ -74,7 +77,14 @@ func IsCommand(trigger string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start uberbot!
|
// SetPresence
|
||||||
|
// Sets the presence struct after a session has been created
|
||||||
|
func SetPresence(presence discordgo.GatewayStatusUpdate) {
|
||||||
|
botPresence = presence
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the bot!
|
||||||
func Start() {
|
func Start() {
|
||||||
// Load all the guilds
|
// Load all the guilds
|
||||||
loadGuilds()
|
loadGuilds()
|
||||||
|
|
@ -94,7 +104,7 @@ func Start() {
|
||||||
// Setup State specific variables
|
// Setup State specific variables
|
||||||
Session.State.MaxMessageCount = messageState
|
Session.State.MaxMessageCount = messageState
|
||||||
Session.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAll)
|
Session.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAll)
|
||||||
|
Session.Identify.Presence = botPresence
|
||||||
// Open the session
|
// Open the session
|
||||||
log.Info("Connecting to Discord...")
|
log.Info("Connecting to Discord...")
|
||||||
err = Session.Open()
|
err = Session.Open()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue