aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-05-03 11:35:39 +0200
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-05-03 11:36:50 +0200
commitfed5dde8e263c0d3f9a7c477d5b5c7705eae8f31 (patch)
tree68bd5c13561da39c6cabfb68555491bbdaf8af95 /main.go
parentf923f36dbf771a47e8b2a124bad32cb8e20a7595 (diff)
build(deps): update to gokord 0.5.0
#6
Diffstat (limited to 'main.go')
-rw-r--r--main.go36
1 files changed, 20 insertions, 16 deletions
diff --git a/main.go b/main.go
index 9964269..e4a9e25 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,7 @@
package main
import (
+ _ "embed"
"flag"
"github.com/anhgelus/gokord"
"github.com/anhgelus/gokord/utils"
@@ -12,22 +13,18 @@ import (
)
var (
- token string
- forceCmdRegistration bool
-)
-
-const (
- Version = "2.2.3" // git version: 0.2.3 (it's the v2 of the bot)
+ token string
+ //go:embed updates.json
+ updatesData []byte
+ Version = gokord.Version{
+ Major: 2,
+ Minor: 3,
+ Patch: 0,
+ } // git version: 0.3.0 (it's the v2 of the bot)
)
func init() {
flag.StringVar(&token, "token", "", "token of the bot")
- flag.BoolVar(
- &forceCmdRegistration,
- "forge-command-registration",
- false,
- "force the registration of command",
- )
flag.Parse()
}
@@ -134,6 +131,11 @@ func main() {
HasOption().
SetHandler(commands.Credits)
+ innovations, err := gokord.LoadInnovationFromJson(updatesData)
+ if err != nil {
+ panic(err)
+ }
+
bot := gokord.Bot{
Token: token,
Status: []*gokord.Status{
@@ -143,7 +145,7 @@ func main() {
},
{
Type: gokord.GameStatus,
- Content: "dev par @anhgelus",
+ Content: "ĂȘtre dev par @anhgelus",
},
{
Type: gokord.ListeningStatus,
@@ -151,7 +153,7 @@ func main() {
},
{
Type: gokord.GameStatus,
- Content: "Les Copaings Bot " + Version,
+ Content: "Les Copaings Bot " + Version.String(),
},
},
Commands: []*gokord.GeneralCommand{
@@ -162,9 +164,11 @@ func main() {
resetUserCmd,
creditsCmd,
},
- AfterInit: afterInit,
+ AfterInit: afterInit,
+ Innovations: innovations,
+ Version: &Version,
}
- bot.Start(forceCmdRegistration)
+ bot.Start()
xp.CloseRedisClient()
}