2021-04-06 09:45:59 +02:00
|
|
|
import "package:nyxx/nyxx.dart";
|
|
|
|
import "package:nyxx_interactions/interactions.dart";
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
final bot = Nyxx("<%TOKEN%>", GatewayIntents.all);
|
|
|
|
final interactions = Interactions(bot);
|
|
|
|
|
|
|
|
interactions
|
|
|
|
..registerHandler("test", "This is test comamnd", [], handler: (event) async {
|
2021-04-10 14:54:13 +02:00
|
|
|
// Acknowledge about event so you can send reply later.
|
|
|
|
// You have 3 second to either ack command or send response
|
|
|
|
await event.acknowledge();
|
2021-04-06 09:45:59 +02:00
|
|
|
|
|
|
|
// After long running task, send response
|
2021-04-10 14:54:13 +02:00
|
|
|
await event.respond(content: "This is example message result");
|
2021-04-06 09:45:59 +02:00
|
|
|
});
|
|
|
|
}
|