From 5a8da1eaeb9434a18e553a5c50490d06b54a6a1d Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Wed, 6 Aug 2025 02:22:06 +0200 Subject: build(gokord): upgrade to latest version --- commands/top.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'commands/top.go') diff --git a/commands/top.go b/commands/top.go index daa1ccb..09fa91f 100644 --- a/commands/top.go +++ b/commands/top.go @@ -2,7 +2,8 @@ package commands import ( "fmt" - "github.com/anhgelus/gokord/utils" + "github.com/anhgelus/gokord/cmd" + "github.com/anhgelus/gokord/logger" "github.com/anhgelus/les-copaings-bot/config" "github.com/anhgelus/les-copaings-bot/exp" "github.com/anhgelus/les-copaings-bot/user" @@ -10,10 +11,10 @@ import ( "sync" ) -func Top(s *discordgo.Session, i *discordgo.InteractionCreate, optMap utils.OptionMap, resp *utils.ResponseBuilder) { +func Top(_ *discordgo.Session, i *discordgo.InteractionCreate, _ cmd.OptionMap, resp *cmd.ResponseBuilder) { err := resp.IsDeferred().Send() if err != nil { - utils.SendAlert("commands/top.go - Sending deferred", err.Error()) + logger.Alert("commands/top.go - Sending deferred", err.Error()) return } embeds := make([]*discordgo.MessageEmbed, 3) @@ -23,18 +24,18 @@ func Top(s *discordgo.Session, i *discordgo.InteractionCreate, optMap utils.Opti defer wg.Done() tops, err := user.GetBestXP(i.GuildID, n, d) if err != nil { - utils.SendAlert("commands/top.go - Fetching best xp", err.Error(), "n", n, "d", d, "id", id, "guild_id", i.GuildID) + logger.Alert("commands/top.go - Fetching best xp", err.Error(), "n", n, "d", d, "id", id, "guild_id", i.GuildID) embeds[id] = &discordgo.MessageEmbed{ Title: s, Description: "Erreur : impossible de récupérer la liste", - Color: utils.Error, + Color: 0x831010, } return } embeds[id] = &discordgo.MessageEmbed{ Title: s, Description: genTopsMessage(tops), - Color: utils.Success, + Color: 0x10E6AD, } } cfg := config.GetGuildConfig(i.GuildID) @@ -57,7 +58,7 @@ func Top(s *discordgo.Session, i *discordgo.InteractionCreate, optMap utils.Opti } err = resp.Send() if err != nil { - utils.SendAlert("commands/top.go - Sending response top", err.Error()) + logger.Alert("commands/top.go - Sending response top", err.Error()) } }() } -- cgit v1.2.3 From c04f4d9fff2e753f0477a07a9f8f43fbcba8969e Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 21 Aug 2025 14:59:23 +0200 Subject: build(go): rename module to use git.anhgelus.world instead of github --- commands/top.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'commands/top.go') diff --git a/commands/top.go b/commands/top.go index 09fa91f..fedea45 100644 --- a/commands/top.go +++ b/commands/top.go @@ -2,13 +2,14 @@ package commands import ( "fmt" + "sync" + + "git.anhgelus.world/anhgelus/les-copaings-bot/config" + "git.anhgelus.world/anhgelus/les-copaings-bot/exp" + "git.anhgelus.world/anhgelus/les-copaings-bot/user" "github.com/anhgelus/gokord/cmd" "github.com/anhgelus/gokord/logger" - "github.com/anhgelus/les-copaings-bot/config" - "github.com/anhgelus/les-copaings-bot/exp" - "github.com/anhgelus/les-copaings-bot/user" "github.com/bwmarrin/discordgo" - "sync" ) func Top(_ *discordgo.Session, i *discordgo.InteractionCreate, _ cmd.OptionMap, resp *cmd.ResponseBuilder) { -- cgit v1.2.3 From 30ecd60b041398390f11fccdf46444fa28690bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Thu, 4 Sep 2025 16:25:59 +0200 Subject: build(gokord): upgrade to latest nightly still use discordgo name before merging anhgelus/gokord with nyttikord/gokord --- commands/top.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands/top.go') diff --git a/commands/top.go b/commands/top.go index fedea45..ecbf6f4 100644 --- a/commands/top.go +++ b/commands/top.go @@ -9,7 +9,7 @@ import ( "git.anhgelus.world/anhgelus/les-copaings-bot/user" "github.com/anhgelus/gokord/cmd" "github.com/anhgelus/gokord/logger" - "github.com/bwmarrin/discordgo" + discordgo "github.com/nyttikord/gokord" ) func Top(_ *discordgo.Session, i *discordgo.InteractionCreate, _ cmd.OptionMap, resp *cmd.ResponseBuilder) { -- cgit v1.2.3