mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-16 04:21:49 +00:00
adding more logging for lash command exceptions
This commit is contained in:
@@ -76,11 +76,16 @@ public class SlashCommandListenerBean extends ListenerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
|
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
|
||||||
if(commands == null || commands.isEmpty()) return;
|
try {
|
||||||
CompletableFuture.runAsync(() -> self.executeListenerLogic(event), slashCommandExecutor).exceptionally(throwable -> {
|
if(commands == null || commands.isEmpty()) return;
|
||||||
log.error("Failed to execute listener logic in async slash command event.", throwable);
|
log.debug("Executing slash command in guild {} from user {}.", event.getGuild().getIdLong(), event.getMember().getIdLong());
|
||||||
return null;
|
CompletableFuture.runAsync(() -> self.executeListenerLogic(event), slashCommandExecutor).exceptionally(throwable -> {
|
||||||
});
|
log.error("Failed to execute listener logic in async slash command event.", throwable);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
} catch (Exception exception) {
|
||||||
|
log.error("Failed to process slash command interaction event.", exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -107,11 +112,15 @@ public class SlashCommandListenerBean extends ListenerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCommandAutoCompleteInteraction(@NotNull CommandAutoCompleteInteractionEvent event) {
|
public void onCommandAutoCompleteInteraction(@NotNull CommandAutoCompleteInteractionEvent event) {
|
||||||
if(commands == null || commands.isEmpty()) return;
|
try {
|
||||||
CompletableFuture.runAsync(() -> self.executeAutCompleteListenerLogic(event), slashCommandAutoCompleteExecutor).exceptionally(throwable -> {
|
if(commands == null || commands.isEmpty()) return;
|
||||||
log.error("Failed to execute listener logic in async auto complete interaction event.", throwable);
|
CompletableFuture.runAsync(() -> self.executeAutCompleteListenerLogic(event), slashCommandAutoCompleteExecutor).exceptionally(throwable -> {
|
||||||
return null;
|
log.error("Failed to execute listener logic in async auto complete interaction event.", throwable);
|
||||||
});
|
return null;
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Failed to process slash command auto complete interaction.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
Reference in New Issue
Block a user