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 --- rolereact/rolereact.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'rolereact/rolereact.go') diff --git a/rolereact/rolereact.go b/rolereact/rolereact.go index dce4e81..44aad2a 100644 --- a/rolereact/rolereact.go +++ b/rolereact/rolereact.go @@ -3,6 +3,7 @@ package rolereact import ( "context" "slices" + "strconv" "git.anhgelus.world/anhgelus/les-copaings-bot/config" "git.anhgelus.world/anhgelus/les-copaings-bot/dynamicid" @@ -54,9 +55,9 @@ func HandleCommand(ctx context.Context, dg bot.Session, i *interaction.Applicati } o := i.OptionMap() c := o["salon"] - var channelID string + var channelID uint64 if c != nil { - channelID = c.Value.(string) + channelID = c.ChannelValue(ctx, dg.ChannelState()).ID } else { channelID = i.ChannelID } @@ -362,7 +363,12 @@ func HandleSetRole(ctx context.Context, dg bot.Session, i *interaction.MessageCo }, } } else { - role.RoleID = i.Data.Values[0] + var err error + role.RoleID, err = strconv.ParseUint(i.Data.Values[0], 10, 64) + if err != nil { + // panic because must ensure before that the value is valid + panic(err) + } responseData = MessageModifyRoleData(ctx, i.Interaction, params, "") } err := interaction.Respond(i.Interaction, &interaction.Response{ -- cgit v1.2.3