nyxx 2.0.0-rc.6 copy "nyxx: ^2.0.0-rc.6" to clipboard
nyxx: ^2.0.0-rc.6 copied to clipboard

outdated

A Discord library for Dart. Simple, robust framework for creating discord bots for Dart language.

example/example.dart

import "package:nyxx/nyxx.dart";

// Main function
void main() {
  // Create new bot instance
  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) {
    print("Ready!");
  });

  // Listen to all incoming messages
  bot.onMessageReceived.listen((e) {
    // Check if message content equals "!ping"
    if (e.message.content == "!ping") {
      // Send "Pong!" to channel where message was received
      e.message.channel.sendMessage(MessageBuilder.content("Pong!"));
    }
  });
}
96
likes
0
pub points
82%
popularity

Publisher

verified publisherl7ssha.xyz

A Discord library for Dart. Simple, robust framework for creating discord bots for Dart language.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

http, logging, path

More

Packages that depend on nyxx