From 89b23632f5ceeebd82132210c1407dc9514a547b Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Sat, 7 Mar 2026 13:20:56 +0100 Subject: feat(gokord): replace snowflake by uint --- events.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'events.go') diff --git a/events.go b/events.go index a9a14a7..855e498 100644 --- a/events.go +++ b/events.go @@ -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( -- cgit v1.2.3