nyxx_interactions 3.3.0 copy "nyxx_interactions: ^3.3.0" to clipboard
nyxx_interactions: ^3.3.0 copied to clipboard

outdated

Nyxx Interactions Module. Discord library for Dart. Simple, robust framework for creating discord bots for Dart language.

example/example.dart

import "package:nyxx/nyxx.dart";
import "package:nyxx_interactions/nyxx_interactions.dart";

void main() {
  final bot = NyxxFactory.createNyxxWebsocket("<TOKEN>", GatewayIntents.allUnprivileged)
    ..registerPlugin(Logging()) // Default logging plugin
    ..registerPlugin(CliIntegration()) // Cli integration for nyxx allows stopping application via SIGTERM and SIGKILl
    ..registerPlugin(IgnoreExceptions()) // Plugin that handles uncaught exceptions that may occur
    ..connect();

  IInteractions.create(WebsocketInteractionBackend(bot))
    ..registerSlashCommand(
        SlashCommandBuilder("itest", "This is test command", [
          CommandOptionBuilder(CommandOptionType.subCommand, "subtest", "This is sub test")
            ..registerHandler((event) => event.respond(MessageBuilder.content("This is example command")))
        ], guild: 302360552993456135.toSnowflake())
    )..syncOnReady();
}
9
likes
90
points
232
downloads

Publisher

verified publisherl7ssha.xyz

Weekly Downloads

Nyxx Interactions Module. Discord library for Dart. Simple, robust framework for creating discord bots for Dart language.

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

crypto, logging, nyxx

More

Packages that depend on nyxx_interactions