Skip to content

Commit

Permalink
Merge pull request #292 from nyxx-discord/dev
Browse files Browse the repository at this point in the history
Release 3.2.4
  • Loading branch information
l7ssha authored Jan 23, 2022
2 parents 4f741e6 + f05ee71 commit ee17a86
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.2.4
__23.01.2022__

- bugfix: Properly serialize member edit payload. Fixes #291
- bugfix: Improve shard searching mechanism. Fixes #290
- bugfix: Fix message deserialization bug with roleMentions. Fixes #289

## 3.2.3
__10.01.2022__

Expand Down
7 changes: 5 additions & 2 deletions lib/src/core/guild/guild.dart
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,12 @@ class Guild extends SnowflakeEntity implements IGuild {
throw UnsupportedError("Cannot use this property with NyxxRest");
}

final shardId = (id.id >> 22) % (client as NyxxWebsocket).shardManager.shards.length;

return (client as NyxxWebsocket).shardManager.shards.firstWhere(
(_shard) => _shard.guilds.contains(id),
orElse: throw InvalidShardException('Cannot find shard for this guild!'),
(element) => element.id == shardId,
orElse: () =>
throw InvalidShardException('Cannot find shard for this guild! Calculated shard id for this guild is: $shardId but no such shard exist'),
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class Message extends SnowflakeEntity implements IMessage {
}

roleMentions = [
if (raw["mention_roles"] != null)
if (raw["mention_roles"] != null && guild != null)
for (var roleId in raw["mention_roles"]) RoleCacheable(client, Snowflake(roleId), guild!)
];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/internal/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Constants {
static const int apiVersion = 9;

/// Version of Nyxx
static const String version = "3.2.3";
static const String version = "3.2.4";

/// Url to Nyxx repo
static const String repoUrl = "https://github.com/nyxx-discord/nyxx";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/internal/http_endpoints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ class HttpEndpoints implements IHttpEndpoints {
..deaf = deaf
..channel = channel;

return executeSafe(BasicRequest("/guilds/$guildId/members/$memberId", method: "PATCH", auditLog: auditReason, body: finalBuilder));
return executeSafe(BasicRequest("/guilds/$guildId/members/$memberId", method: "PATCH", auditLog: auditReason, body: finalBuilder.build()));
}

@override
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: nyxx
version: 3.2.3
version: 3.2.4
description: A Discord library for Dart. Simple, robust framework for creating discord bots for Dart language.
homepage: https://github.com/nyxx-discord/nyxx
repository: https://github.com/nyxx-discord/nyxx
Expand Down

0 comments on commit ee17a86

Please sign in to comment.