Added himbucks

This commit is contained in:
2024-11-05 00:19:36 -06:00
parent 6a55017624
commit 9a1b3723bc
5 changed files with 209 additions and 4 deletions

24
main.go
View File

@ -43,12 +43,22 @@ var (
},
},
},
{
Name: "balance",
Description: "Check your himbucks balance",
},
{
Name: "leaderboard",
Description: "View the himbucks leaderboard",
},
}
commandHandlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate){
"ping": lib.HandleCommand("ping", 5*time.Second, command.PingCommand),
"hs": lib.HandleCommand("hs", 10*time.Second, command.HsCommand),
"markov": lib.HandleCommand("markov", 30*time.Second, command.MarkovCommand),
"ping": lib.HandleCommand("ping", 5*time.Second, command.PingCommand),
"hs": lib.HandleCommand("hs", 10*time.Second, command.HsCommand),
"markov": lib.HandleCommand("markov", 30*time.Second, command.MarkovCommand),
"balance": lib.HandleCommand("balance", 5*time.Second, command.BalanceCommand),
"leaderboard": lib.HandleCommand("leaderboard", 5*time.Second, command.LeaderboardCommand),
}
)
@ -74,7 +84,13 @@ func main() {
dg.AddHandler(ready)
dg.AddHandler(interactionCreate)
dg.Identify.Intents = discordgo.IntentsGuilds
dg.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) {
if err := lib.ProcessMessage(s, m); err != nil {
log.Printf("Error processing message for himbucks: %v", err)
}
})
dg.Identify.Intents = discordgo.IntentsGuilds | discordgo.IntentsGuildMessages
err = dg.Open()
if err != nil {