diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-03-07 13:20:56 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-03-07 13:29:46 +0100 |
| commit | 89b23632f5ceeebd82132210c1407dc9514a547b (patch) | |
| tree | 647782dc5f1b1148893c10bc8b3e712b6ea8362b /events.go | |
| parent | 9da4d0379b10da8b33563dcd280aa2a9586aa3fb (diff) | |
feat(gokord): replace snowflake by uintrefactor/leave-old-gokord
Diffstat (limited to 'events.go')
| -rw-r--r-- | events.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -54,12 +54,12 @@ func OnVoiceUpdate(ctx context.Context, dg bot.Session, e *event.VoiceStateUpdat } cfg := config.GetGuildConfig(ctx, e.GuildID) dis := cfg.IsDisabled(ctx, dg, e.BeforeUpdate.ChannelID) - if (e.BeforeUpdate == nil || dis) && e.ChannelID != "" { + if (e.BeforeUpdate == nil || dis) && e.ChannelID != 0 { if dis { return } onConnection(ctx, dg, e) - } else if e.BeforeUpdate != nil && (e.ChannelID == "" || dis) { + } else if e.BeforeUpdate != nil && (e.ChannelID == 0 || dis) { if dis { return } @@ -67,8 +67,8 @@ func OnVoiceUpdate(ctx context.Context, dg bot.Session, e *event.VoiceStateUpdat } } -func genMapKey(guildID string, userID string) string { - return fmt.Sprintf("%s:%s", guildID, userID) +func genMapKey(guildID, userID uint64) string { + return fmt.Sprintf("%d:%d", guildID, userID) } func onConnection(ctx context.Context, _ bot.Session, e *event.VoiceStateUpdate) { @@ -100,7 +100,7 @@ func onDisconnect(ctx context.Context, dg bot.Session, e *event.VoiceStateUpdate e.Member.GuildID = e.GuildID cc.AddXP(ctx, dg, e.Member, exp.VocalXP(uint(timeInVocal)), func(_ uint, newLevel uint) { cfg := config.GetGuildConfig(ctx, e.GuildID) - if len(cfg.FallbackChannel) == 0 { + if cfg.FallbackChannel == 0 { return } _, err := channel.SendMessage(cfg.FallbackChannel, fmt.Sprintf( |
