Skip to content

Commit c95f899

Browse files
committed
Added ExampleSlashCommand
1 parent 8e43b2a commit c95f899

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.javadiscord.jdi.example;
2+
3+
import com.javadiscord.jdi.core.CommandOptionType;
4+
import com.javadiscord.jdi.core.annotations.CommandOption;
5+
import com.javadiscord.jdi.core.annotations.EventListener;
6+
import com.javadiscord.jdi.core.annotations.SlashCommand;
7+
8+
@EventListener
9+
public class ExampleSlashCommand {
10+
11+
@SlashCommand(
12+
name = "quiz",
13+
description = "A fun Java quiz",
14+
options = {
15+
@CommandOption(name = "q1", description = "What is an Integer?", type = CommandOptionType.STRING),
16+
@CommandOption(name = "q2", description = "What package is List in?", type = CommandOptionType.STRING),
17+
@CommandOption(name = "q3", description = "What does JVM stand for?", type = CommandOptionType.STRING),
18+
@CommandOption(name = "q4", description = "Is a String a primitive?", type = CommandOptionType.STRING),
19+
}
20+
)
21+
public void handle() {
22+
//TODO: Logic to handle the slash command
23+
}
24+
}

0 commit comments

Comments
 (0)