Skip to content

Commit

Permalink
Merge pull request #295 from nyxx-discord/dev
Browse files Browse the repository at this point in the history
Release 3.2.5
  • Loading branch information
l7ssha authored Jan 30, 2022
2 parents ee17a86 + 42c4f4d commit 31bd2e2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 3.2.5
__30.01.2022__

- bugfix: Serialization error with permissions on ChannelBuilder. Fixes #294
- bugfix: Fix MemberBuilder serialization json error

## 3.2.4
__23.01.2022__

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.4";
static const String version = "3.2.5";

/// Url to Nyxx repo
static const String repoUrl = "https://github.com/nyxx-discord/nyxx";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/builders/channel_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class ChannelBuilder implements Builder {
if (type != null) "type": type!.value,
if (position != null) "position": position,
if (parentChannel != null) "parent_id": parentChannel!.id.toString(),
if (permissionOverrides != null) "permission_overwrites": permissionOverrides!.map((e) => e.build()),
if (permissionOverrides != null) "permission_overwrites": permissionOverrides!.map((e) => e.build().build()).toList(),
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/builders/member_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MemberBuilder implements Builder {
if (roles != null) 'roles': roles!.map((e) => e.toString()).toList(),
if (mute != null) 'mute': mute,
if (deaf != null) 'deaf': deaf,
if (channel != Snowflake.zero()) 'channel_id': channel,
if (channel != Snowflake.zero()) 'channel_id': channel.toString(),
if (timeoutUntil?.millisecondsSinceEpoch != 0) 'communication_disabled_until': timeoutUntil?.toIso8601String(),
};
}
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.4
version: 3.2.5
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
10 changes: 10 additions & 0 deletions test/unit/builders_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ main() {
expect(cacheableBuilder.build(), equals({"message_id": '123', "fail_if_not_exists": true}));
});

group("channel builder", () {
test('ChannelBuilder', () {
final builder = TextChannelBuilder.create("test");
builder.permissionOverrides = [PermissionOverrideBuilder.from(0, Snowflake.zero(), Permissions.empty())];

final expectedResult = {'permission_overwrites': [{'allow': 0, 'deny': 122406567679}], 'name': 'test'};
expect(builder.build(), expectedResult);
});
});

group('presence_builder.dart', () {
test('PresenceBuilder', () {
final activityBuilder = ActivityBuilder.game("test game name");
Expand Down

0 comments on commit 31bd2e2

Please sign in to comment.