diff --git a/.gitignore b/.gitignore index 16b8f2b..2881224 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -uberbot -.env -guilds/*.json -.vscode +# ignore IDE related files .idea -.DS_Store +.vscode diff --git a/core.go b/core.go index ebc90b8..bf1487a 100644 --- a/core.go +++ b/core.go @@ -51,6 +51,16 @@ var ColorSuccess = 0x55F485 // The color to use for response embeds reporting failure var ColorFailure = 0xF45555 +// BotPresence +var botPresence discordgo.GatewayStatusUpdate + +// SetPresence +// Sets the gateway field for bot presence +func SetPresence(presence discordgo.GatewayStatusUpdate) { + botPresence = presence + return +} + // AddAdmin // A function that allows admins to be added, but not removed func AddAdmin(userId string) { @@ -102,7 +112,7 @@ func dgoLog(msgL, caller int, format string, a ...interface{}) { } } -// Start uberbot! +// Start the bot. func Start() { discordgo.Logger = dgoLog // Load all the guilds @@ -126,15 +136,7 @@ func Start() { Session.SyncEvents = false Session.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAll) // Set the bots status - Session.Identify.Presence = discordgo.GatewayStatusUpdate{ - Game: discordgo.Activity{ - Name: "Mega Man Battle Network", - Type: 3, - }, - Status: "dnd", - AFK: true, - Since: 91879201, - } + Session.Identify.Presence = botPresence // Open the session log.Info("Connecting to Discord...") err = Session.Open()