From f829a3263e9864ea40c6382f60620626fa6f3d79 Mon Sep 17 00:00:00 2001 From: Riley Date: Tue, 13 Jul 2021 12:57:57 -0700 Subject: [PATCH] add a method to set gateway status --- core.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core.go b/core.go index 75e2d2d..fc7de05 100644 --- a/core.go +++ b/core.go @@ -33,6 +33,9 @@ var Session *discordgo.Session // This is a boolean map, because checking its values is dead simple this way var botAdmins = make(map[string]bool) +// BotPresence +var botPresence discordgo.GatewayStatusUpdate + // BotToken // 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 @@ -74,7 +77,14 @@ func IsCommand(trigger string) bool { 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() { // Load all the guilds loadGuilds() @@ -94,7 +104,7 @@ func Start() { // Setup State specific variables Session.State.MaxMessageCount = messageState Session.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAll) - + Session.Identify.Presence = botPresence // Open the session log.Info("Connecting to Discord...") err = Session.Open()