Skip to content

nyxx-discord/nyxx_lavalink

Repository files navigation

nyxx_lavalink

Discord Shield pub documentation

Simple, robust framework for creating discord bots for Dart language.


Features

  • Lavalink support
    Nyxx allows you to create music bots by adding support to Lavalink API
  • Fine Control
    Nyxx allows you to control every outgoing HTTP request or WebSocket message.

Quick example

Lavalink

void main() async {
  final bot = NyxxFactory.createNyxxWebsocket("<TOKEN>", GatewayIntents.allUnprivileged);

  final guildId = Snowflake("GUILD_ID");
  final channelId = Snowflake("CHANNEL_ID");

  final cluster = ICluster.createCluster(bot, Snowflake("BOT_ID"));
  await cluster.addNode(NodeOptions());

  bot.eventsWs.onMessageReceived.listen((event) async {
    if (event.message.content == "!join") {
      final channel = await bot.fetchChannel<IVoiceGuildChannel>(channelId);

      cluster.getOrCreatePlayerNode(guildId);

      channel.connect();
    } else {
      final node = cluster.getOrCreatePlayerNode(guildId);

      final searchResults = await node.searchTracks(event.message.content);

      node.play(guildId, searchResults.tracks[0]).queue();
    }
  });
}

Other nyxx packages

More examples

Nyxx examples can be found here.

Example bots

Documentation, help and examples

Dartdoc documentation for latest stable version is hosted on pub

You can read docs and wiki articles for latest stable version on my website. This website also hosts docs for latest dev changes to framework (dev branch)

If you need assistance in developing bot using nyxx you can join official nyxx discord guild.

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.

Contributing to Nyxx

Read contributing document

Credits