adrianjagielak / nyxx

Wrapper around Discord API for Dart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool



Build Status Pub documentation

Simple, robust framework for creating discord bots for Dart language. This is a fork of Hackzzila's nyx.


Features

  • Commands framework included
    A fast way to create a bot with command support. Implementing the framework is simple - and everything is done automatically.
  • Cross Platform
    Nyxx works on the command line, in the browser, and on mobile devices.
  • Fine Control
    Nyxx allows you to control every outgoing HTTP request or WebSocket message.
  • Complete
    Nyxx supports nearly all Discord API endpoints.

Sample

Basic usage:

void main() {
  final bot = NyxxVm(Platform.environment['DISCORD_TOKEN']);
  
  bot.onMessageReceived.listen((MessageEvent e) {
    if (e.message.content == "!ping") {
      e.message.channel.send(content: "Pong!");
    }
  });
}

Commands:

void main() {
  final bot = NyxxVm(Platform.environment['DISCORD_TOKEN']);
  
  CommandsFramework('!', bot)
    ..admins = [nyxx.Snowflake("302359032612651009")]
    ..registerLibraryCommands();
}

@Command(name: "single")
Future<void> single(CommandContext context) async {
  await context.reply(content: "WORKING");
}

Documentation, help and examples

Discord API documentation features rich descriptions about all topics that nyxx covers.

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 to the library on my website.

Wiki documentation are designed to match the latest Nyxx release.

About

Wrapper around Discord API for Dart

License:Other


Languages

Language:Dart 99.6%Language:Shell 0.3%Language:CSS 0.1%