initial code commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package bot
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
Commands "ion606_bot/Bot/Commands"
|
||||
helpers "ion606_bot/Bot/Helpers"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
)
|
||||
|
||||
var commandsList = []*discordgo.ApplicationCommand{
|
||||
Commands.MeowCommand,
|
||||
Commands.PurrCommand,
|
||||
Commands.BoopCommand,
|
||||
Commands.HugCommand,
|
||||
Commands.CuddleCommand,
|
||||
Commands.SnuggleCommand,
|
||||
Commands.CatfactCommand,
|
||||
}
|
||||
|
||||
func RegisterCommands(s *discordgo.Session, guildID string) {
|
||||
for _, cmd := range commandsList {
|
||||
_, err := s.ApplicationCommandCreate(s.State.User.ID, guildID, cmd)
|
||||
if err != nil {
|
||||
log.Printf("Cannot create '%v' command: %v", cmd.Name, err)
|
||||
// Handle error using HandleError
|
||||
helpers.HandleError(s, nil, err)
|
||||
} else {
|
||||
log.Printf("Registered command: %v", cmd.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user