From fed5dde8e263c0d3f9a7c477d5b5c7705eae8f31 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Fri, 3 May 2024 11:35:39 +0200 Subject: build(deps): update to gokord 0.5.0 #6 --- main.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'main.go') 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() } -- cgit v1.2.3