63 lines
1.4 KiB
Java
63 lines
1.4 KiB
Java
package netneutrality.command.basic;
|
|
/*
|
|
* Copyright (c) anthorob
|
|
*
|
|
* https://discord.gg/qUa6zNFZsd
|
|
*/
|
|
|
|
import net.dv8tion.jda.api.interactions.commands.build.SlashCommandData;
|
|
import netneutrality.command.AbstractCommand;
|
|
import netneutrality.command.CommandType;
|
|
import netneutrality.core.context.MessageCommandContext;
|
|
import netneutrality.core.context.SlashCommandContext;
|
|
|
|
public class PingCommand extends AbstractCommand {
|
|
|
|
@Override
|
|
public boolean needAdmin() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isEnabled() {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean isGuildOnly() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public String getCommandName() {
|
|
return "ping";
|
|
}
|
|
|
|
@Override
|
|
public String getDescription() {
|
|
return "Pong!";
|
|
}
|
|
|
|
@Override
|
|
public void registerSlashCommandOptions(SlashCommandData data) {
|
|
|
|
}
|
|
|
|
@Override
|
|
public CommandType getType() {
|
|
return CommandType.UTILITY;
|
|
}
|
|
|
|
@Override
|
|
public void execute(MessageCommandContext context) {
|
|
if (context.getArgs().length == 0)
|
|
context.reply(String.format("Pong! [%d ms]", context.getJDA().getGatewayPing()));
|
|
}
|
|
|
|
@Override
|
|
public void execute(SlashCommandContext context) {
|
|
context.reply(String.format("Pong! [%d ms]", context.getJDA().getGatewayPing()));
|
|
}
|
|
|
|
}
|