-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathPingCommand.java
More file actions
39 lines (30 loc) · 1.29 KB
/
PingCommand.java
File metadata and controls
39 lines (30 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.namelessmc.bot.commands;
import static com.namelessmc.bot.Language.Term.PING_DESCRIPTION;
import org.checkerframework.checker.nullness.qual.Nullable;
import com.namelessmc.bot.Language;
import com.namelessmc.bot.util.EmbedUtil;
import com.namelessmc.java_api.NamelessAPI;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.interactions.InteractionHook;
import net.dv8tion.jda.api.interactions.commands.DefaultMemberPermissions;
import net.dv8tion.jda.api.interactions.commands.build.CommandData;
import net.dv8tion.jda.api.interactions.commands.build.Commands;
public class PingCommand extends Command {
PingCommand() {
super("ping");
}
@Override
public CommandData getCommandData(final Language language) {
return Commands.slash(this.name, language.get(PING_DESCRIPTION))
.setDefaultPermissions(DefaultMemberPermissions.DISABLED);
}
@Override
public void execute(final SlashCommandInteractionEvent event,
final InteractionHook hook,
final Language language,
final Guild guild,
final @Nullable NamelessAPI api) {
hook.sendMessageEmbeds(EmbedUtil.message(event.getJDA(), "This command has been removed, please use '/configure test' instead.")).queue();
}
}