mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-25 20:04:01 +00:00
[AB-53] adding economy related commands
adding runtime exception to root command handling adding simple custom command module disabling slash command for show emote the utility is not given (the bot cannot show any emotes from servers its not in) fixing post target setup not allowing threads fixing post targets not supporting threads fixing interactions not considering the actual amount of embeds fixing some cases for events which are not in a guild
This commit is contained in:
@@ -54,19 +54,6 @@ public class ShowEmote extends AbstractConditionableCommand {
|
||||
.thenApply(aVoid -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
String emoteText = slashCommandParameterService.getCommandOption(EMOTE_PARAMETER, event, Emote.class, String.class);
|
||||
Emoji emoji = Emoji.fromMarkdown(emoteText);
|
||||
Emote emote = event.getJDA().getEmoteById(emoji.getId());
|
||||
ShowEmoteLog emoteLog = ShowEmoteLog
|
||||
.builder()
|
||||
.emote(emote)
|
||||
.build();
|
||||
return interactionService.replyEmbed(SHOW_EMOTE_RESPONSE_TEMPLATE, emoteLog, event)
|
||||
.thenApply(interactionHook -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
@@ -82,16 +69,8 @@ public class ShowEmote extends AbstractConditionableCommand {
|
||||
.templated(true)
|
||||
.build();
|
||||
|
||||
SlashCommandConfig slashCommandConfig = SlashCommandConfig
|
||||
.builder()
|
||||
.enabled(true)
|
||||
.rootCommandName(UtilitySlashCommandNames.UTILITY)
|
||||
.commandName(SHOW_EMOTE_COMMAND)
|
||||
.build();
|
||||
|
||||
return CommandConfiguration.builder()
|
||||
.name(SHOW_EMOTE_COMMAND)
|
||||
.slashCommandConfig(slashCommandConfig)
|
||||
.module(UtilityModuleDefinition.UTILITY)
|
||||
.templated(true)
|
||||
.async(true)
|
||||
|
||||
Reference in New Issue
Block a user