Skip to content

Commit

Permalink
feat(commands): Implemented the new command system for the PingCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Greazi-Times committed Nov 9, 2023
1 parent 32b0d82 commit dbb3c0a
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,26 @@
* Proprietary and confidential
*/

package com.greazi.discordbotfoundation.command.general;

import com.greazi.discordbotfoundation.handlers.commands.SimpleSlashCommand;
import com.greazi.discordbotfoundation.utils.SimpleEmbedBuilder;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
package com.greazi.discordbotfoundation.command;

import java.awt.*;

/**
* A simple ping command to get the latency of the bot
* The message output can be changed by overriding this file!
*/
public class PingCommand extends SimpleSlashCommand {
public class PingCommand extends SimpleCommand {

/**
* Default enabled can not be disabled.
*/
public PingCommand() {
super("ping");
description("Test the latency of the bot");
setDescription("Get the latency of the bot");
}

/**
* The main code of the ping command
*
* @param event SlashCommandInteractionEvent
*/
@Override
protected void onCommand(final SlashCommandInteractionEvent event) {
protected void onCommand() {
event.replyEmbeds(new SimpleEmbedBuilder("Bot latency")
.text("Gateway: " + event.getJDA().getGatewayPing(),
"Rest: " + event.getJDA().getRestPing().complete(),
Expand Down

0 comments on commit dbb3c0a

Please sign in to comment.