Skip to content

Commit 5234032

Browse files
authored
Merge pull request #362 from tharun634/main
Added close alias
2 parents 93d1d34 + 99bda11 commit 5234032

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package net.javadiscord.javabot.systems.help.commands;
2+
3+
import net.dv8tion.jda.api.interactions.commands.OptionType;
4+
import net.dv8tion.jda.api.interactions.commands.build.Commands;
5+
6+
/**
7+
* A simple command that can be used inside reserved help channels to immediately unreserve them,
8+
* instead of waiting for a timeout.
9+
* An alias to /unreserve
10+
*/
11+
public class CloseCommand extends UnreserveCommand {
12+
13+
/**
14+
* The constructor of this class, which sets the corresponding
15+
* {@link net.dv8tion.jda.api.interactions.commands.build.SlashCommandData}.
16+
*/
17+
public CloseCommand() {
18+
setSlashCommandData(
19+
Commands.slash("close", "Unreserves this help channel so that others can use it.")
20+
.setGuildOnly(true).addOption(OptionType.STRING, "reason",
21+
"The reason why you're unreserving this channel", false));
22+
}
23+
}

0 commit comments

Comments
 (0)