-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (35 loc) · 1.31 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"github.com/bwmarrin/discordgo"
"github.com/theovidal/onyxcord"
"github.com/BecauseOfProg/xbop/commands"
"github.com/BecauseOfProg/xbop/games/connect_four"
"github.com/BecauseOfProg/xbop/games/hangman"
"github.com/BecauseOfProg/xbop/games/irregular_verbs"
"github.com/BecauseOfProg/xbop/games/tic_tac_toe"
)
func main() {
bot := onyxcord.RegisterBot("XBOP")
bot.ApplicationCommands = discordCommands()
bot.CommandHandlers = map[string]*onyxcord.Command{
"verbs": irregular_verbs.Command(),
"hangman": hangman.Command(),
"about": commands.About(),
"connect-four": connect_four.Command(),
"Défier au Puissance 4": connect_four.Command(),
"tic-tac-toe": tic_tac_toe.Command(),
"Défier au morpion": tic_tac_toe.Command(),
}
bot.ComponentHandlers = map[string]onyxcord.Component{
"connectfour": connect_four.HandleOngoingGame,
"hangman": hangman.HandleInteraction,
"tictactoe": tic_tac_toe.HandleInteraction,
}
bot.AddHandler(func(session *discordgo.Session, message *discordgo.MessageCreate) {
_ = hangman.HandleMessage(&bot, message.Message)
irregular_verbs.HandleOngoingGame(&bot, message.Message)
})
go subscribe(&bot)
bot.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsGuildMessages | discordgo.IntentsDirectMessages)
bot.Start()
}