Skip to content

Commit

Permalink
Update mentions field in message update event to be nullable (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
abitofevrything authored Oct 2, 2023
1 parent 141e444 commit 17dfca5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/gateway/gateway.dart
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ class Gateway extends GatewayManager with EventParser {
manager: client.guilds[guildId ?? Snowflake.zero].members,
),
),
mentions: parseMany(raw['mentions'] as List<Object?>, client.users.parse),
mentions: maybeParseMany(raw['mentions'], client.users.parse),
message: (client.channels[channelId] as PartialTextChannel).messages[id],
oldMessage: (client.channels[channelId] as PartialTextChannel).messages.cache[id],
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/gateway/events/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MessageUpdateEvent extends DispatchEvent {
final PartialMember? member;

/// A list of users explicitly mentioned in the message.
final List<User> mentions;
final List<User>? mentions;

/// The updated message.
final PartialMessage message;
Expand Down

0 comments on commit 17dfca5

Please sign in to comment.