nevetS-Bot/src/main/java/tech/nevets/nevetsbot/commands/games/DiceCmd.java
2021-09-21 16:09:02 -04:00

31 lines
824 B
Java

package tech.nevets.nevetsbot.commands.games;
import tech.nevets.nevetsbot.Bot;
import tech.nevets.nevetsbot.commands.CommandContext;
import tech.nevets.nevetsbot.commands.ICommand;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
public class DiceCmd implements ICommand {
@Override
public void handle(CommandContext ctx) {
Random rand = ThreadLocalRandom.current();
int roll = rand.nextInt(6) + 1;
ctx.getChannel().sendTyping().queue();
ctx.getChannel().sendMessage("Your roll: " + roll).queue();
}
@Override
public String getName() {
return "dice";
}
@Override
public String getHelp() {
return "Returns a value from 1-6" +
"Usage: `" + Bot.prefix + "dice`";
}
}