Skip to content

Commit

Permalink
Merge pull request #263 from nyxx-discord/dev
Browse files Browse the repository at this point in the history
Release 3.0.1
  • Loading branch information
l7ssha authored Dec 21, 2021
2 parents 5b3c58b + 1e04c4e commit 6997546
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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__

Expand All @@ -16,6 +25,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
Expand Down
4 changes: 2 additions & 2 deletions lib/nyxx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
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.0.0";
static const String version = "3.0.1";

/// Url to Nyxx repo
static const String repoUrl = "https://github.com/nyxx-discord/nyxx";
Expand Down
9 changes: 7 additions & 2 deletions lib/src/internal/shard/shard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -528,7 +533,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;
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions lib/src/plugin/plugins/ignore_exception.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'dart:isolate';

import 'package:logging/logging.dart';
Expand All @@ -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);
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.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
Expand Down

0 comments on commit 6997546

Please sign in to comment.