From 8e2b31059ae543d4e35c9ad3e581081db4a1eede Mon Sep 17 00:00:00 2001 From: Riley Date: Mon, 16 Aug 2021 22:12:20 -0700 Subject: [PATCH] fix some minor issues with slash command registering --- core.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/core.go b/core.go index bf1487a..a9e4b5d 100644 --- a/core.go +++ b/core.go @@ -43,6 +43,10 @@ var botAdmins = make(map[string]bool) // Similar to BotAdmins, this isn't saved to .json and is added programmatically var botToken = "" +// BotTestingId +// A string of the testing guild. Used for slash commands +var botTestingId = "" + // ColorSuccess // The color to use for response embeds reporting success var ColorSuccess = 0x55F485 @@ -73,6 +77,12 @@ func SetToken(token string) { botToken = token } +// SetTestingId +// A function that allows a single id to be added, but not removed +func SetTestingId(token string) { + botTestingId = token +} + // IsAdmin // Allow commands to check if a user is an admin or not // Since botAdmins is a boolean map, if they are not in the map, false is the default @@ -173,16 +183,17 @@ func Start() { if numAdmins == 0 { log.Warning("You have not added any bot admins! Only moderators will be able to run commands, and permissions cannot be changed!") } - // Register slash commands - //slashChannel := make(chan string) - //log.Info("Registering slash commands") - //go AddSlashCommands("833901685054242846", slashChannel) + + //Register slash commands + slashChannel := make(chan string) + log.Info("Registering slash commands") + go AddSlashCommands(botTestingId, slashChannel) // Bot ready log.Info("Initialization complete! The bot is now ready.") - // Info about slash commands - //log.Info(<-slashChannel) + //Info about slash commands + log.Info(<-slashChannel) // -- GRACEFUL TERMINATION -- //