aboutsummaryrefslogtreecommitdiff
path: root/commands/top.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-05-13 12:50:20 +0200
committerAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-05-13 12:50:20 +0200
commitc408afc8797b0da5e1d73d190a8f5884870b510c (patch)
treeb87eb4aab9f3e1f89bea29a2ce846efe324f7374 /commands/top.go
parent0a445aa1c73bc1410899c53778ae090a24c38dac (diff)
style(files): reorganize everything
Diffstat (limited to 'commands/top.go')
-rw-r--r--commands/top.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/commands/top.go b/commands/top.go
index 8320fe9..22574ce 100644
--- a/commands/top.go
+++ b/commands/top.go
@@ -4,12 +4,13 @@ import (
"fmt"
"github.com/anhgelus/gokord"
"github.com/anhgelus/gokord/utils"
- "github.com/anhgelus/les-copaings-bot/xp"
+ "github.com/anhgelus/les-copaings-bot/exp"
+ "github.com/anhgelus/les-copaings-bot/user"
"github.com/bwmarrin/discordgo"
)
func Top(s *discordgo.Session, i *discordgo.InteractionCreate) {
- xp.LastEventUpdate(s, xp.GetCopaing(i.Member.User.ID, i.GuildID))
+ user.LastEventUpdate(s, user.GetCopaing(i.Member.User.ID, i.GuildID))
resp := utils.ResponseBuilder{C: s, I: i}
err := resp.IsDeferred().Send()
if err != nil {
@@ -18,14 +19,14 @@ func Top(s *discordgo.Session, i *discordgo.InteractionCreate) {
}
resp.NotDeferred().IsEdit()
go func() {
- var tops []xp.Copaing
- gokord.DB.Where("guild_id = ?", i.GuildID).Limit(10).Order("xp desc").Find(&tops)
+ var tops []user.Copaing
+ gokord.DB.Where("guild_id = ?", i.GuildID).Limit(10).Order("exp desc").Find(&tops)
msg := ""
for i, c := range tops {
if i == 9 {
- msg += fmt.Sprintf("%d. **<@%s>** - niveau %d", i+1, c.DiscordID, xp.Level(c.XP))
+ msg += fmt.Sprintf("%d. **<@%s>** - niveau %d", i+1, c.DiscordID, exp.Level(c.XP))
} else {
- msg += fmt.Sprintf("%d. **<@%s>** - niveau %d\n", i+1, c.DiscordID, xp.Level(c.XP))
+ msg += fmt.Sprintf("%d. **<@%s>** - niveau %d\n", i+1, c.DiscordID, exp.Level(c.XP))
}
}
err = resp.Embeds([]*discordgo.MessageEmbed{