Skip to content

Commit

Permalink
Merge pull request #56 from Greazi-Times/features/reworked-commands
Browse files Browse the repository at this point in the history
Slash Commands Rework
  • Loading branch information
Greazi-Times authored Apr 26, 2024
2 parents eb8d51d + efb78b2 commit e02bee6
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 187 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/greazi/discordbotfoundation/SimpleBot.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.greazi.discordbotfoundation;

import com.greazi.discordbotfoundation.command.PingCommand;
import com.greazi.discordbotfoundation.tests.ReplyCommand;
import com.greazi.discordbotfoundation.command.SimpleCommand;
import com.greazi.discordbotfoundation.command.SlashCommandHandler;
import com.greazi.discordbotfoundation.tests.MainCommand;
import com.greazi.discordbotfoundation.constants.Constants;
import com.greazi.discordbotfoundation.debug.BotException;
import com.greazi.discordbotfoundation.mysql.SqlManager;
Expand Down Expand Up @@ -174,6 +176,12 @@ public SimpleBot() {
new PingCommand()
);

// Register tests commands
registerCommands(
new ReplyCommand(),
new MainCommand()
);

// Call the onBotStart method
onBotStart();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class PingCommand extends SimpleCommand {
public PingCommand() {
super("ping");
setDescription("Get the latency of the bot - 1");
setMainGuildOnly(true);
}

@Override
protected void onCommand() {
public void onCommand() {
Common.warning("Ping command executed");
replyEmbed("Bot latency",
"Gateway: " + event.getJDA().getGatewayPing(),
Expand Down
Loading

0 comments on commit e02bee6

Please sign in to comment.