Basic usage:
void main() {
var bot = Nyxx("TOKEN");
bot.onMessageReceived.listen((event) {
if (event.message.content == "!ping") {
event.message.channel.send(content: "Pong!");
}
});
}
Commands:
void main() {
final bot = Nyxx("TOKEN");
Commander(bot, prefix: "!!!")
..registerCommand("ping", (context, message) => context.reply(content: "Pong!"));
}
Nyxx examples can be found here.
Commander examples can be found here
Dartdoc documentation is hosted on pub. This wiki just fills gap in docs with more descriptive guides and tutorials.
Discord API documentation features rich descriptions about all topics that nyxx covers.
The unofficial guild for Discord Bot developers. To get help with nyxx check #dart_nyxx channel.
The dartdocs page will always have the documentation for the latest release.
You can read about upcoming changes in the library on my website.
Wiki documentation are designed to match the latest Nyxx release.
Run this command:
With Dart:
$ dart pub add nyxx
With Flutter:
$ flutter pub add nyxx
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
nyxx: ^1.0.2
Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:nyxx/nyxx.dart';