From dbb3c0a76665c9bc4ba84433ff9d2883231451c4 Mon Sep 17 00:00:00 2001 From: Greazi Date: Thu, 9 Nov 2023 21:36:18 +0100 Subject: [PATCH] feat(commands): Implemented the new command system for the PingCommand --- .../command/{general => }/PingCommand.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) rename src/main/java/com/greazi/discordbotfoundation/command/{general => }/PingCommand.java (59%) diff --git a/src/main/java/com/greazi/discordbotfoundation/command/general/PingCommand.java b/src/main/java/com/greazi/discordbotfoundation/command/PingCommand.java similarity index 59% rename from src/main/java/com/greazi/discordbotfoundation/command/general/PingCommand.java rename to src/main/java/com/greazi/discordbotfoundation/command/PingCommand.java index aa15f2c..a3837b6 100644 --- a/src/main/java/com/greazi/discordbotfoundation/command/general/PingCommand.java +++ b/src/main/java/com/greazi/discordbotfoundation/command/PingCommand.java @@ -5,11 +5,7 @@ * 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.*; @@ -17,23 +13,18 @@ * 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(),