fix some minor issues with slash command registering
This commit is contained in:
parent
cafc1b7e64
commit
8e2b31059a
23
core.go
23
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 -- //
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue