Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
💡 when interaction isn't loaded or non exists send 'typing' in channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinnih-1 committed Dec 24, 2022
1 parent e279ee6 commit b08de4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public ForceApprovalCommand() {
public void execute(Member member, Message message, String[] args) {
val paymentManager = InitBot.paymentManager;
val channel = message.getChannel().asTextChannel();
message.delete().queue();

if (args.length == 0) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public void onSelectMenuInteraction(@NotNull SelectMenuInteractionEvent event) {
.filter(interaction -> interaction.getId().equals(event.getSelectMenu().getId()))
.findAny()
.ifPresentOrElse(interaction -> ((InteractionService<SelectMenuInteractionEvent>)interaction).execute(event),
() -> Logger.getGlobal().severe("Unloaded interaction id: " + event.getSelectMenu().getId()));
() -> {
Logger.getGlobal().severe("Unloaded interaction id: " + event.getSelectMenu().getId());
});
}

@Override
Expand Down Expand Up @@ -65,6 +67,7 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {
val args = Arrays.stream(message.replaceFirst(PREFIX, "").split(" "))
.skip(1).toArray(String[]::new);

event.getMessage().delete().queue();
command.execute(event.getMember(), event.getMessage(), args);
}, () -> {
Logger.getGlobal().severe("Unloaded slash command id " + commandMessage);
Expand Down

0 comments on commit b08de4f

Please sign in to comment.