Add GatewayIntents.none; Update examples; Bump version

This commit is contained in:
Szymon Uglis 2021-03-28 18:35:40 +02:00 committed by Szymon Uglis
parent 2ab9cd1b6e
commit 8966773ab6
No known key found for this signature in database
GPG key ID: 112376C5BEE91FE2
10 changed files with 13 additions and 10 deletions

View file

@ -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("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -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("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -11,7 +11,7 @@ DiscordColor getColorForUserFromMessage(Message message) {
// Main function
void main() {
// Create new bot instance. Replace string with your token
final bot = Nyxx("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -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("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -14,7 +14,7 @@ SnowflakeEntity getUserToBan(GuildMessage message) {
// Main function
void main() {
// Create new bot instance. Replace string with your token
final bot = Nyxx("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -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("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -3,7 +3,7 @@ import "package:nyxx/nyxx.dart";
// Main function
void main() {
// Create new bot instance
final bot = Nyxx("<TOKEN>");
final bot = Nyxx("<TOKEN>", 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) {

View file

@ -5,7 +5,7 @@ import "package:nyxx/nyxx.dart";
// Main function
void main() {
// Create new bot instance
final bot = Nyxx("<TOKEN>");
final bot = Nyxx("<TOKEN>", GatewayIntents.none);
// Listen to ready event. Invoked when bot started listening to events.
bot.onReady.listen((ReadyEvent e) {

View file

@ -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.

View file

@ -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: