Skip to content

Commit

Permalink
Fix incorrect snowflake serialization (#595)
Browse files Browse the repository at this point in the history
* Update component.dart

* Update component.dart
  • Loading branch information
MCausc78 authored Dec 1, 2023
1 parent 43df51b commit a81ee15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/builders/message/component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ButtonBuilder extends MessageComponentBuilder {
if (label != null) 'label': label,
if (emoji != null)
'emoji': {
'id': emoji!.id == Snowflake.zero ? null : emoji!.id,
'id': emoji!.id == Snowflake.zero ? null : emoji!.id.toString(),
'name': emoji!.name,
if (emoji is GuildEmoji) 'animated': (emoji as GuildEmoji).isAnimated == true,
},
Expand Down Expand Up @@ -223,7 +223,7 @@ class SelectMenuOptionBuilder extends CreateBuilder<SelectMenuOption> {
if (description != null) 'description': description,
if (emoji != null)
'emoji': {
'id': emoji!.id.value,
'id': emoji!.id.toString(),
'name': emoji!.name,
'animated': emoji is GuildEmoji && (emoji as GuildEmoji).isAnimated == true,
},
Expand Down

0 comments on commit a81ee15

Please sign in to comment.