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 /rolereact/rolereact.go | |
| parent | 9da4d0379b10da8b33563dcd280aa2a9586aa3fb (diff) | |
feat(gokord): replace snowflake by uintrefactor/leave-old-gokord
Diffstat (limited to 'rolereact/rolereact.go')
| -rw-r--r-- | rolereact/rolereact.go | 12 |
1 files changed, 9 insertions, 3 deletions
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{ |
