cleanup commands
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package cc.fascinated.bat.command.impl;
|
||||
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.model.BatUser;
|
||||
@ -17,9 +18,9 @@ import org.springframework.stereotype.Component;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "avatar", description = "Get the avatar of a user")
|
||||
public class AvatarCommand extends BatCommand {
|
||||
public AvatarCommand() {
|
||||
super("avatar", "Gets the avatar of a user");
|
||||
super.addOption(OptionType.USER, "user", "The user to get the avatar of", true);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cc.fascinated.bat.command.impl;
|
||||
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.common.TimeUtils;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
@ -23,6 +24,7 @@ import java.lang.management.RuntimeMXBean;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "botstats", description = "Shows the bot statistics")
|
||||
public class BotStatsCommand extends BatCommand {
|
||||
RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
|
||||
private final GuildService guildService;
|
||||
@ -30,7 +32,6 @@ public class BotStatsCommand extends BatCommand {
|
||||
|
||||
@Autowired
|
||||
public BotStatsCommand(@NonNull GuildService guildService, @NonNull UserService userService) {
|
||||
super("botstats", "Shows the bot statistics");
|
||||
this.guildService = guildService;
|
||||
this.userService = userService;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import cc.fascinated.bat.Consts;
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.BatSubCommand;
|
||||
import cc.fascinated.bat.command.Category;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.event.EventListener;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
@ -35,12 +36,12 @@ import java.util.Map;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "help", description = "View the bots command categories.")
|
||||
public class HelpCommand extends BatCommand implements EventListener {
|
||||
private final CommandService commandService;
|
||||
|
||||
@Autowired
|
||||
public HelpCommand(@NonNull CommandService commandService) {
|
||||
super("help", "View the bots command categories.");
|
||||
this.commandService = commandService;
|
||||
}
|
||||
|
||||
@ -74,7 +75,7 @@ public class HelpCommand extends BatCommand implements EventListener {
|
||||
BatSubCommand subCommand = entry.getValue();
|
||||
SubcommandData commandData = subCommand.getCommandData();
|
||||
commands += "</%s %s:%s> - %s\n".formatted(
|
||||
command.getName(),
|
||||
command.getCommandInfo().name(),
|
||||
commandData.getName(),
|
||||
subCommand.getCommandSnowflake(),
|
||||
commandData.getDescription()
|
||||
@ -83,9 +84,9 @@ public class HelpCommand extends BatCommand implements EventListener {
|
||||
continue;
|
||||
}
|
||||
commands += "</%s:%s> - %s\n".formatted(
|
||||
command.getName(),
|
||||
command.getCommandInfo().name(),
|
||||
command.getCommandSnowflake(),
|
||||
command.getDescription()
|
||||
command.getCommandInfo().description()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cc.fascinated.bat.command.impl;
|
||||
|
||||
import cc.fascinated.bat.Consts;
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.model.BatUser;
|
||||
@ -15,11 +16,8 @@ import org.springframework.stereotype.Component;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "invite", description = "Invite the bot to your server!")
|
||||
public class InviteCommand extends BatCommand {
|
||||
public InviteCommand() {
|
||||
super("invite", "Invite the bot to your server!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
interaction.replyEmbeds(EmbedUtils.genericEmbed()
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cc.fascinated.bat.command.impl;
|
||||
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.model.BatUser;
|
||||
import cc.fascinated.bat.service.DiscordService;
|
||||
@ -14,11 +15,8 @@ import org.springframework.stereotype.Component;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "ping", description = "Gets the ping of the bot")
|
||||
public class PingCommand extends BatCommand {
|
||||
public PingCommand() {
|
||||
super("ping", "Gets the ping of the bot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
long time = System.currentTimeMillis();
|
||||
|
@ -2,6 +2,7 @@ package cc.fascinated.bat.command.impl.fun;
|
||||
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.Category;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.common.WebRequest;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
@ -17,11 +18,8 @@ import org.springframework.stereotype.Component;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "cat", description = "Get a random cat image", category = Category.FUN)
|
||||
public class CatCommand extends BatCommand {
|
||||
public CatCommand() {
|
||||
super(Category.FUN, "cat", "Get a random cat image");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
CatImageToken[] responseEntity = WebRequest.getAsEntity("https://api.thecatapi.com/v1/images/search", CatImageToken[].class);
|
||||
|
@ -2,6 +2,7 @@ package cc.fascinated.bat.command.impl.fun;
|
||||
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.Category;
|
||||
import cc.fascinated.bat.command.CommandInfo;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.common.WebRequest;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
@ -17,11 +18,8 @@ import org.springframework.stereotype.Component;
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
@Component
|
||||
@CommandInfo(name = "dog", description = "Get a random dog image", category = Category.FUN)
|
||||
public class DogCommand extends BatCommand {
|
||||
public DogCommand() {
|
||||
super(Category.FUN, "dog", "Get a random dog image");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
|
||||
RandomImage responseEntity = WebRequest.getAsEntity("https://dog.ceo/api/breeds/image/random", RandomImage.class);
|
||||
|
Reference in New Issue
Block a user