aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-04-14 17:11:31 +0200
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-04-14 17:11:31 +0200
commit1078cf3deb94ef22c65510b42c8e7f0dc50a036a (patch)
tree25f1e9e22f0ce88a3840cca5434201fbafdd20de /main.go
parent1f68e698991d7bb1c9a5519536b2215185de0616 (diff)
feat(xp): xp and level gain
Diffstat (limited to 'main.go')
-rw-r--r--main.go27
1 files changed, 25 insertions, 2 deletions
diff --git a/main.go b/main.go
index cb3c33a..7197396 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,8 @@ package main
import (
"flag"
"github.com/anhgelus/gokord"
+ "github.com/anhgelus/les-copaings-bot/xp"
+ "github.com/bwmarrin/discordgo"
)
var token string
@@ -18,6 +20,21 @@ func main() {
panic(err)
}
+ err = gokord.DB.AutoMigrate(&xp.Copaing{})
+ if err != nil {
+ panic(err)
+ }
+
+ //rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'une personne").
+ // HasOption().
+ // AddOption(gokord.NewOption(
+ // discordgo.ApplicationCommandOptionUser,
+ // "copaing",
+ // "Le niveau du Copaing que vous souhaitez obtenir",
+ // )).
+ // SetHandler(commands.Rank).
+ // ToCmd()
+
bot := gokord.Bot{
Token: token,
Status: []*gokord.Status{
@@ -27,8 +44,14 @@ func main() {
Url: "",
},
},
- Commands: nil,
- Handlers: nil,
+ Commands: []*gokord.Cmd{
+ //rankCmd,
+ },
+ AfterInit: afterInit,
}
bot.Start()
}
+
+func afterInit(dg *discordgo.Session) {
+ dg.AddHandler(xp.OnMessage)
+}