Skip to content

Commit

Permalink
Merge pull request #299 from nyxx-discord/dev
Browse files Browse the repository at this point in the history
Release 3.2.7
  • Loading branch information
l7ssha authored Feb 8, 2022
2 parents 8f8cdb2 + 3242279 commit 0578eff
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.2.7
__08.02.2022__

- bugfix: Remove noop constructor parameters. Deprecate old parameters on INyxxFactory

## 3.2.6
__01.02.2022__

Expand Down
2 changes: 1 addition & 1 deletion example/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() async {
bot.eventsWs.onMessageReceived.listen((IMessageReceivedEvent e) async {
// Check if message content equals "!embed"
if (e.message.content == "!create_channel") {
// Make sure that message was sent in guild not im dm, because we cant add roles in dms
// Make sure that message was sent in guild not in dm, because we cant add roles in dms
if(e.message.guild != null) {
return;
}
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.6";
static const String version = "3.2.7";

/// Url to Nyxx repo
static const String repoUrl = "https://github.com/nyxx-discord/nyxx";
Expand Down
31 changes: 14 additions & 17 deletions lib/src/nyxx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ import 'package:nyxx/src/typedefs.dart';

abstract class NyxxFactory {
static INyxx createNyxxRest(String token, int intents, Snowflake appId,
{ClientOptions? options, CacheOptions? cacheOptions, bool ignoreExceptions = true, bool useDefaultLogger = true}) =>
NyxxRest(token, intents, appId, options: options, cacheOptions: cacheOptions, ignoreExceptions: ignoreExceptions, useDefaultLogger: useDefaultLogger);
{ClientOptions? options,
CacheOptions? cacheOptions,
@Deprecated("Use IgnoreException plugin") bool ignoreExceptions = true,
@Deprecated("Use Logging plugin") bool useDefaultLogger = true}) =>
NyxxRest(token, intents, appId, options: options, cacheOptions: cacheOptions);

static INyxxWebsocket createNyxxWebsocket(String token, int intents,
{ClientOptions? options, CacheOptions? cacheOptions, bool ignoreExceptions = true, bool useDefaultLogger = true}) =>
NyxxWebsocket(token, intents, options: options, cacheOptions: cacheOptions, ignoreExceptions: ignoreExceptions, useDefaultLogger: useDefaultLogger);
{ClientOptions? options,
CacheOptions? cacheOptions,
@Deprecated("Use IgnoreException plugin") bool ignoreExceptions = true,
@Deprecated("Use Logging plugin") bool useDefaultLogger = true}) =>
NyxxWebsocket(token, intents, options: options, cacheOptions: cacheOptions);
}

/// Generic interface for Nyxx. Represents basic functionality of Nyxx that are always available.
Expand Down Expand Up @@ -182,9 +188,8 @@ class NyxxRest extends INyxxRest {

/// Creates and logs in a new client. If [ignoreExceptions] is true (by default is)
/// isolate will ignore all exceptions and continue to work.
NyxxRest(this.token, this.intents, this._appId,
{ClientOptions? options, CacheOptions? cacheOptions, bool ignoreExceptions = true, bool useDefaultLogger = true}) {
_logger.fine("Staring Nyxx: intents: [$intents]; ignoreExceptions: [$ignoreExceptions]; useDefaultLogger: [$useDefaultLogger]");
NyxxRest(this.token, this.intents, this._appId, {ClientOptions? options, CacheOptions? cacheOptions}) {
_logger.fine("Staring Nyxx: intents: [$intents]");

if (token.isEmpty) {
throw MissingTokenError();
Expand Down Expand Up @@ -330,16 +335,8 @@ class NyxxWebsocket extends NyxxRest implements INyxxWebsocket {

/// Creates and logs in a new client. If [ignoreExceptions] is true (by default is)
/// isolate will ignore all exceptions and continue to work.
NyxxWebsocket(String token, int intents, {ClientOptions? options, CacheOptions? cacheOptions, bool ignoreExceptions = true, bool useDefaultLogger = true})
: super(
token,
intents,
Snowflake.zero(),
options: options,
cacheOptions: cacheOptions,
ignoreExceptions: ignoreExceptions,
useDefaultLogger: useDefaultLogger,
) {
NyxxWebsocket(String token, int intents, {ClientOptions? options, CacheOptions? cacheOptions})
: super(token, intents, Snowflake.zero(), options: options, cacheOptions: cacheOptions) {
eventsWs = WebsocketEventController(this);
}

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.6
version: 3.2.7
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 0578eff

Please sign in to comment.