Skip to content

Commit

Permalink
fix(presence): set null where presence wasn't founded
Browse files Browse the repository at this point in the history
  • Loading branch information
LeadcodeDev committed Dec 30, 2023
1 parent 074ed7c commit 3d84072
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/src/internal/websockets/packets/presence_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ class PresenceUpdatePacket with Container implements WebsocketPacket {
case ActivityType.streaming:
return StreamingActivity.from(payload['guild_id'], activity);
default:
return GuildMemberActivity(
ActivityType.values.firstWhere((type) => type.value == activity['type']),
activity['name']
);
return null;
}
}).toList();
}).whereNotNull().toList();


afterMember.presence = GuildMemberPresence(
Expand Down

0 comments on commit 3d84072

Please sign in to comment.