Skip to content

Commit

Permalink
feat(command): Redo of the ping command
Browse files Browse the repository at this point in the history
  • Loading branch information
Greazi-Times committed Jan 24, 2024
1 parent 8fcf61d commit 8770035
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.greazi.discordbotfoundation.command;

import java.awt.*;
import com.greazi.discordbotfoundation.Common;

/**
* A simple ping command to get the latency of the bot
Expand All @@ -20,16 +20,16 @@ public class PingCommand extends SimpleCommand {
*/
public PingCommand() {
super("ping");
setDescription("Get the latency of the bot");
setDescription("Get the latency of the bot - 1");
}

@Override
protected void onCommand() {
event.replyEmbeds(new SimpleEmbedBuilder("Bot latency")
.text("Gateway: " + event.getJDA().getGatewayPing(),
"Rest: " + event.getJDA().getRestPing().complete(),
"Response: " + event.getJDA().getResponseTotal())
.setColor(Color.decode("#2f3136"))
.build()).setEphemeral(true).queue();
Common.warning("Ping command executed");
replyEmbed("Bot latency",
"Gateway: " + event.getJDA().getGatewayPing(),
"Rest: " + event.getJDA().getRestPing().complete(),
"Response: " + event.getJDA().getResponseTotal()
);
}
}

0 comments on commit 8770035

Please sign in to comment.