From 8966773ab699c1520b21f941d9a6194a2be855d5 Mon Sep 17 00:00:00 2001 From: Szymon Uglis Date: Sun, 28 Mar 2021 18:35:40 +0200 Subject: [PATCH] Add GatewayIntents.none; Update examples; Bump version --- nyxx/example/channel.dart | 2 +- nyxx/example/create-add-role.dart | 2 +- nyxx/example/embeds.dart | 2 +- nyxx/example/invite.dart | 2 +- nyxx/example/kick-ban.dart | 2 +- nyxx/example/permissions.dart | 2 +- nyxx/example/ping-pong.dart | 2 +- nyxx/example/sending-file.dart | 2 +- nyxx/lib/src/ClientOptions.dart | 3 +++ nyxx/pubspec.yaml | 4 ++-- 10 files changed, 13 insertions(+), 10 deletions(-) diff --git a/nyxx/example/channel.dart b/nyxx/example/channel.dart index f15dd2b7..2055494e 100644 --- a/nyxx/example/channel.dart +++ b/nyxx/example/channel.dart @@ -3,7 +3,7 @@ import "package:nyxx/nyxx.dart"; // Main function void main() { // Create new bot instance. Replace string with your token - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/example/create-add-role.dart b/nyxx/example/create-add-role.dart index fd5bdf52..3f48dddf 100644 --- a/nyxx/example/create-add-role.dart +++ b/nyxx/example/create-add-role.dart @@ -3,7 +3,7 @@ import "package:nyxx/nyxx.dart"; // Main function void main() { // Create new bot instance. Replace string with your token - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/example/embeds.dart b/nyxx/example/embeds.dart index 037e9f33..642e566d 100644 --- a/nyxx/example/embeds.dart +++ b/nyxx/example/embeds.dart @@ -11,7 +11,7 @@ DiscordColor getColorForUserFromMessage(Message message) { // Main function void main() { // Create new bot instance. Replace string with your token - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/example/invite.dart b/nyxx/example/invite.dart index 1f75717e..e8cebf39 100644 --- a/nyxx/example/invite.dart +++ b/nyxx/example/invite.dart @@ -3,7 +3,7 @@ import "package:nyxx/nyxx.dart"; // Main function void main() { // Create new bot instance. Replace string with your token - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/example/kick-ban.dart b/nyxx/example/kick-ban.dart index ba392667..d7a5b71b 100644 --- a/nyxx/example/kick-ban.dart +++ b/nyxx/example/kick-ban.dart @@ -14,7 +14,7 @@ SnowflakeEntity getUserToBan(GuildMessage message) { // Main function void main() { // Create new bot instance. Replace string with your token - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/example/permissions.dart b/nyxx/example/permissions.dart index a9bfc812..b9192ffa 100644 --- a/nyxx/example/permissions.dart +++ b/nyxx/example/permissions.dart @@ -3,7 +3,7 @@ import "package:nyxx/nyxx.dart"; // Main function void main() { // Create new bot instance. Replace string with your token - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/example/ping-pong.dart b/nyxx/example/ping-pong.dart index c7c5bf20..da92ed5e 100644 --- a/nyxx/example/ping-pong.dart +++ b/nyxx/example/ping-pong.dart @@ -3,7 +3,7 @@ import "package:nyxx/nyxx.dart"; // Main function void main() { // Create new bot instance - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot is connected to all shards. Note that cache can be empty or not incomplete. bot.onReady.listen((e) { diff --git a/nyxx/example/sending-file.dart b/nyxx/example/sending-file.dart index 40faf685..71a6100e 100644 --- a/nyxx/example/sending-file.dart +++ b/nyxx/example/sending-file.dart @@ -5,7 +5,7 @@ import "package:nyxx/nyxx.dart"; // Main function void main() { // Create new bot instance - final bot = Nyxx(""); + final bot = Nyxx("", GatewayIntents.none); // Listen to ready event. Invoked when bot started listening to events. bot.onReady.listen((ReadyEvent e) { diff --git a/nyxx/lib/src/ClientOptions.dart b/nyxx/lib/src/ClientOptions.dart index 57eb99e0..105bb787 100644 --- a/nyxx/lib/src/ClientOptions.dart +++ b/nyxx/lib/src/ClientOptions.dart @@ -143,6 +143,9 @@ class GatewayIntents { /// All intents static const int all = allUnprivileged | allPrivileged; + + /// No intents. Client shouldn't receive any events. + static const int none = 0; } /// Hook executed when disposing bots process. diff --git a/nyxx/pubspec.yaml b/nyxx/pubspec.yaml index 8d5d5f7e..82615416 100644 --- a/nyxx/pubspec.yaml +++ b/nyxx/pubspec.yaml @@ -1,5 +1,5 @@ name: nyxx -version: 1.1.0-dev.5 +version: 1.1.0-dev.8 description: A Discord library for Dart. homepage: https://github.com/l7ssha/nyxx repository: https://github.com/l7ssha/nyxx @@ -11,7 +11,7 @@ environment: dependencies: http: "^0.13.0" - logging: "^1.0.0" + logging: "^1.0.1" path: "^1.8.0" dev_dependencies: