From 1c989230dc3ac672741190a6012405d4484b811f Mon Sep 17 00:00:00 2001 From: Szymon Uglis Date: Mon, 20 Dec 2021 23:55:29 +0100 Subject: [PATCH 1/7] Add missing info about Guild Scheduled Events --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 296bfbd9e..098afe054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ __19.12.2021__ > Previously similar behavior was available but wasn't working as intended. - Implemented ITextVoiceTextChannel. > Discords beta feature `chat in voice channels` was implemented in form of `ITextVoiceTextChannel` interface +- Added support for Guild Scheduled Events - Do not send auth header when it's not needed - Added support for Dart 2.15 - Fixup message update payload deserialization From aaec0998d2aba5a9191468bacb1852da479de976 Mon Sep 17 00:00:00 2001 From: Abitofevrything <54505189+abitofevrything@users.noreply.github.com> Date: Tue, 21 Dec 2021 19:30:42 +0100 Subject: [PATCH 2/7] Fix CliItegration plugin not working with IgnoreExceptions (#256) --- lib/src/plugin/plugins/ignore_exception.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/plugin/plugins/ignore_exception.dart b/lib/src/plugin/plugins/ignore_exception.dart index 82fc077d4..62a77c721 100644 --- a/lib/src/plugin/plugins/ignore_exception.dart +++ b/lib/src/plugin/plugins/ignore_exception.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'dart:isolate'; import 'package:logging/logging.dart'; @@ -15,6 +16,10 @@ class IgnoreExceptions extends BasePlugin { final stackTrace = err[1] != null ? ". Stacktrace: \n${err[1]}" : ""; logger.shout("Got Error: Message: [${err[0]}]$stackTrace"); + + if (err[0].startsWith('UnrecoverableNyxxError') as bool) { + Isolate.current.kill(); + } }); Isolate.current.addErrorListener(errorsPort.sendPort); From 19634704fe048834bf66414a4528c75b7e123ade Mon Sep 17 00:00:00 2001 From: Abitofevrything <54505189+abitofevrything@users.noreply.github.com> Date: Tue, 21 Dec 2021 19:30:58 +0100 Subject: [PATCH 3/7] Use logger instead of print (#259) --- lib/src/internal/shard/shard.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/internal/shard/shard.dart b/lib/src/internal/shard/shard.dart index 1ccf6c98c..a5674653e 100644 --- a/lib/src/internal/shard/shard.dart +++ b/lib/src/internal/shard/shard.dart @@ -528,7 +528,7 @@ class Shard implements IShard { if (manager.connectionManager.client.options.dispatchRawShardEvent) { manager.onRawEventController.add(RawEvent(this, rawPayload)); } else { - print("UNKNOWN OPCODE: $rawPayload"); + manager.logger.info("UNKNOWN OPCODE: $rawPayload"); } } break; From 4971cd4af77b21de8a9a3bad87deac91a4af85da Mon Sep 17 00:00:00 2001 From: Abitofevrything <54505189+abitofevrything@users.noreply.github.com> Date: Tue, 21 Dec 2021 19:31:10 +0100 Subject: [PATCH 4/7] Fix typo in file name (#260) * Fix typo in file name * Also fix typo in export * Fix formatting --- lib/nyxx.dart | 2 +- lib/src/plugin/{plugin_manger.dart => plugin_manager.dart} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/src/plugin/{plugin_manger.dart => plugin_manager.dart} (100%) diff --git a/lib/nyxx.dart b/lib/nyxx.dart index eb4c6dfc7..f9278ba0d 100644 --- a/lib/nyxx.dart +++ b/lib/nyxx.dart @@ -167,7 +167,7 @@ export 'src/utils/permissions.dart' show PermissionsUtils; export 'src/utils/utils.dart' show ListSafeFirstWhere; export 'src/plugin/plugin.dart' show BasePlugin; -export 'src/plugin/plugin_manger.dart' show IPluginManager; +export 'src/plugin/plugin_manager.dart' show IPluginManager; export 'src/plugin/plugins/cli_integration.dart' show CliIntegration; export 'src/plugin/plugins/ignore_exception.dart' show IgnoreExceptions; export 'src/plugin/plugins/logging.dart' show Logging; diff --git a/lib/src/plugin/plugin_manger.dart b/lib/src/plugin/plugin_manager.dart similarity index 100% rename from lib/src/plugin/plugin_manger.dart rename to lib/src/plugin/plugin_manager.dart From 588442f10dc13e9e934222a35da8749f4bce1f41 Mon Sep 17 00:00:00 2001 From: Szymon Uglis Date: Tue, 21 Dec 2021 19:31:27 +0100 Subject: [PATCH 5/7] bug: Nullable close code (#261) * bug: Nullable close code * bug: Code review - Make it warning with better message --- lib/src/internal/shard/shard.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/internal/shard/shard.dart b/lib/src/internal/shard/shard.dart index a5674653e..a3a9069e0 100644 --- a/lib/src/internal/shard/shard.dart +++ b/lib/src/internal/shard/shard.dart @@ -226,7 +226,12 @@ class Shard implements IShard { } void _handleError(dynamic data) { - final closeCode = data["errorCode"] as int; + final closeCode = data["errorCode"] as int?; + + if (closeCode == null) { + manager.logger.warning("Received null close = client is probably closing. Payload: `$data`"); + return; + } _connected = false; _heartbeatTimer.cancel(); From 5dd849f103ef4c26b324df714461ffb4acb244e5 Mon Sep 17 00:00:00 2001 From: Szymon Uglis Date: Tue, 21 Dec 2021 19:31:49 +0100 Subject: [PATCH 6/7] bug: Missing ActivityBuilder (#262) --- lib/nyxx.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nyxx.dart b/lib/nyxx.dart index f9278ba0d..dfab87bec 100644 --- a/lib/nyxx.dart +++ b/lib/nyxx.dart @@ -157,7 +157,7 @@ export 'src/utils/builders/guild_builder.dart' show GuildBuilder, RoleBuilder; export 'src/utils/builders/channel_builder.dart'; export 'src/utils/builders/message_builder.dart' show MessageBuilder, MessageDecoration; export 'src/utils/builders/permissions_builder.dart' show PermissionOverrideBuilder, PermissionsBuilder; -export 'src/utils/builders/presence_builder.dart' show PresenceBuilder; +export 'src/utils/builders/presence_builder.dart' show PresenceBuilder, ActivityBuilder; export 'src/utils/builders/reply_builder.dart' show ReplyBuilder; export 'src/utils/builders/sticker_builder.dart' show StickerBuilder; export 'src/utils/builders/thread_builder.dart' show ThreadArchiveTime, ThreadBuilder; From 1e04c4e66e41bbac82d62c80bc950e423d5540bf Mon Sep 17 00:00:00 2001 From: Szymon Uglis Date: Tue, 21 Dec 2021 19:33:55 +0100 Subject: [PATCH 7/7] Release 3.0.1 --- CHANGELOG.md | 9 +++++++++ lib/src/internal/constants.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 098afe054..016acf7bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 3.0.1 +__21.12.2021__ + +- Fix CliItegration plugin not working with IgnoreExceptions (#256) +- Use logger instead of print (#259) +- Fix typo in file name (#260) +- Nullable close code (#261) +- Missing ActivityBuilder (#262) + ## 3.0.0 __19.12.2021__ diff --git a/lib/src/internal/constants.dart b/lib/src/internal/constants.dart index 531549eb9..e451b7b4c 100644 --- a/lib/src/internal/constants.dart +++ b/lib/src/internal/constants.dart @@ -33,7 +33,7 @@ class Constants { static const int apiVersion = 9; /// Version of Nyxx - static const String version = "3.0.0"; + static const String version = "3.0.1"; /// Url to Nyxx repo static const String repoUrl = "https://github.com/nyxx-discord/nyxx"; diff --git a/pubspec.yaml b/pubspec.yaml index 900ccb7cc..5e6d56768 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: nyxx -version: 3.0.0 +version: 3.0.1 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