From 628d6165ecb4498b366ae1bf02bd95a026bf4372 Mon Sep 17 00:00:00 2001 From: twonirwana Date: Sun, 29 Sep 2024 20:52:40 +0200 Subject: [PATCH] better logging on error (#572) * better logging on error --- .../bot/command/AbstractSlashCommand.java | 6 ++--- .../janno/discord/bot/command/RollAnswer.java | 2 +- .../command/customDice/CustomDiceCommand.java | 2 +- .../command/directRoll/DirectRollCommand.java | 23 +++++++++++++++++-- .../discord/bot/ButtonEventAdaptorMock.java | 2 +- .../discord/bot/SlashEventAdaptorMock.java | 2 +- .../customDice/CustomDiceCommandMockTest.snap | 2 +- .../customDice/CustomDiceCommandTest.java | 4 ++-- .../directRoll/DirectRollCommandMockTest.snap | 2 +- .../directRoll/DirectRollCommandTest.java | 4 ++-- .../directRoll/ValidationCommandTest.java | 4 ++-- .../discord/connector/api/Requester.java | 14 +++++++++-- .../connector/jda/ButtonEventAdapterImpl.java | 2 +- .../connector/jda/DiscordAdapterImpl.java | 16 ++++++------- .../discord/connector/jda/JdaClient.java | 17 ++++++++------ .../connector/jda/SlashCommandRegistry.java | 6 ++--- .../connector/jda/SlashEventAdapterImpl.java | 2 +- 17 files changed, 70 insertions(+), 40 deletions(-) diff --git a/bot/src/main/java/de/janno/discord/bot/command/AbstractSlashCommand.java b/bot/src/main/java/de/janno/discord/bot/command/AbstractSlashCommand.java index 0c00428f..eec86c75 100644 --- a/bot/src/main/java/de/janno/discord/bot/command/AbstractSlashCommand.java +++ b/bot/src/main/java/de/janno/discord/bot/command/AbstractSlashCommand.java @@ -149,7 +149,7 @@ protected Collection additionalCommandOptions() { } final Locale userOrConfigLocale = BaseCommandOptions.getLocaleOptionFromStartCommandOption(options) .orElse(event.getRequester().getUserLocal()); - Optional validationMessage = getStartOptionsValidationMessage(options, event.getChannelId(), event.getUserId(), userOrConfigLocale); + Optional validationMessage = getStartOptionsValidationMessage(options, event.getChannelId(), event.getUserId(), Optional.ofNullable(userOrConfigLocale).orElse(Locale.ENGLISH)); if (validationMessage.isPresent()) { log.info("{}: Validation message: {} for {}", event.getRequester().toLogString(), validationMessage.get().replace("\n", " "), @@ -157,7 +157,7 @@ protected Collection additionalCommandOptions() { //todo i18n? return event.reply(String.format("%s\n%s", commandString, validationMessage.get()), true); } - final C config = getConfigFromStartOptions(options, userOrConfigLocale); + final C config = getConfigFromStartOptions(options, Optional.ofNullable(userOrConfigLocale).orElse(Locale.ENGLISH)); final UUID configUUID = uuidSupplier.get(); BotMetrics.incrementSlashStartMetricCounter(getCommandId()); @@ -171,7 +171,7 @@ protected Collection additionalCommandOptions() { commandString.replace("`", "").replace("\n", " ")); String replayMessage = Stream.of(commandString, getConfigWarnMessage(config, userLocale).orElse(null)) .filter(s -> !Strings.isNullOrEmpty(s)) - .collect(Collectors.joining(" ")); + .collect(Collectors.joining("\n")); return event.reply(replayMessage, false) .then(Mono.defer(() -> { diff --git a/bot/src/main/java/de/janno/discord/bot/command/RollAnswer.java b/bot/src/main/java/de/janno/discord/bot/command/RollAnswer.java index d4c44dd2..8b858198 100644 --- a/bot/src/main/java/de/janno/discord/bot/command/RollAnswer.java +++ b/bot/src/main/java/de/janno/discord/bot/command/RollAnswer.java @@ -15,7 +15,7 @@ import java.util.function.Supplier; @Value -@Builder +@Builder(toBuilder = true) public class RollAnswer { @NonNull AnswerFormatType answerFormatType; diff --git a/bot/src/main/java/de/janno/discord/bot/command/customDice/CustomDiceCommand.java b/bot/src/main/java/de/janno/discord/bot/command/customDice/CustomDiceCommand.java index b631c29e..2c411932 100644 --- a/bot/src/main/java/de/janno/discord/bot/command/customDice/CustomDiceCommand.java +++ b/bot/src/main/java/de/janno/discord/bot/command/customDice/CustomDiceCommand.java @@ -207,7 +207,7 @@ private List createButtonLayout(UUID configUUID, CustomD }) .filter(s -> !Strings.isNullOrEmpty(s)) .distinct() - .collect(Collectors.joining(", ")))); + .collect(Collectors.joining("\n")))); } } diff --git a/bot/src/main/java/de/janno/discord/bot/command/directRoll/DirectRollCommand.java b/bot/src/main/java/de/janno/discord/bot/command/directRoll/DirectRollCommand.java index b915da1c..afcbc388 100644 --- a/bot/src/main/java/de/janno/discord/bot/command/directRoll/DirectRollCommand.java +++ b/bot/src/main/java/de/janno/discord/bot/command/directRoll/DirectRollCommand.java @@ -3,6 +3,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.base.Stopwatch; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; import de.janno.discord.bot.AnswerInteractionType; import de.janno.discord.bot.BotMetrics; import de.janno.discord.bot.I18n; @@ -56,6 +58,22 @@ public DirectRollCommand(PersistenceManager persistenceManager, CachingDiceEvalu this.expressionOptionName = expressionOptionName; } + private static EmbedOrMessageDefinition createAnswerWithOptionalWarning(RollAnswer answer) { + EmbedOrMessageDefinition answerMessage = RollAnswerConverter.toEmbedOrMessageDefinition(answer); + if (!Strings.isNullOrEmpty(answer.getWarning()) && + answerMessage.getType() == EmbedOrMessageDefinition.Type.EMBED + && answerMessage.getFields().size() < 25) { + answerMessage = answerMessage.toBuilder() + .fields(ImmutableList.builder() + .addAll(answerMessage.getFields()) + .add(new EmbedOrMessageDefinition.Field("Warning", answer.getWarning(), false)) + .build() + ) + .build(); + } + return answerMessage; + } + @Override public @NonNull String getCommandId() { return ROLL_COMMAND_ID; @@ -153,8 +171,9 @@ protected EmbedOrMessageDefinition getHelpMessage(Locale userLocale) { @NonNull Stopwatch stopwatch, @NonNull Locale userLocale) { - //ignore warning, no good way to display it - Mono answerMono = Mono.defer(() -> event.replyWithEmbedOrMessageDefinition(RollAnswerConverter.toEmbedOrMessageDefinition(answer), false)); + final EmbedOrMessageDefinition answerMessage = createAnswerWithOptionalWarning(answer); + + Mono answerMono = Mono.defer(() -> event.replyWithEmbedOrMessageDefinition(answerMessage, false)); return answerMono .doOnSuccess(v -> { BotMetrics.timerAnswerMetricCounter(getCommandId(), stopwatch.elapsed()); diff --git a/bot/src/test/java/de/janno/discord/bot/ButtonEventAdaptorMock.java b/bot/src/test/java/de/janno/discord/bot/ButtonEventAdaptorMock.java index f4badc5a..53e9997e 100644 --- a/bot/src/test/java/de/janno/discord/bot/ButtonEventAdaptorMock.java +++ b/bot/src/test/java/de/janno/discord/bot/ButtonEventAdaptorMock.java @@ -138,7 +138,7 @@ public Mono editMessage(@Nullable String message, @Nullable List res = underTest.handleSlashCommandEvent(event, () -> UUID.fromString("00000000-0000-0000-0000-000000000000"), Locale.ENGLISH); @@ -285,7 +285,7 @@ void handleSlashCommandEvent_help() { when(event.getOption("help")).thenReturn(Optional.of(CommandInteractionOption.builder() .name("help") .build())); - when(event.getRequester()).thenReturn(new Requester("userName", "channelName", "guildName", "shard 1/1", Locale.ENGLISH)); + when(event.getRequester()).thenReturn(new Requester("userName", "channelName", "guildName", "shard 1/1", Locale.ENGLISH, null)); when(event.replyWithEmbedOrMessageDefinition(any(), anyBoolean())).thenReturn(Mono.just(mock(Void.class))); Mono res = underTest.handleSlashCommandEvent(event, () -> UUID.fromString("00000000-0000-0000-0000-000000000000"), Locale.ENGLISH); diff --git a/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandMockTest.snap b/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandMockTest.snap index 2ae34799..564b2710 100644 --- a/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandMockTest.snap +++ b/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandMockTest.snap @@ -119,7 +119,7 @@ de.janno.discord.bot.command.directRoll.DirectRollCommandMockTest.roll_multiLine de.janno.discord.bot.command.directRoll.DirectRollCommandMockTest.roll_warn=[ [ - "replyWithEmbedOrMessageDefinition: EmbedOrMessageDefinition(title=20 ⇒ 20, descriptionOrContent=, fields=[], componentRowDefinitions=[], hasImage=false, type=EMBED, userReference=true, sendToOtherChannelId=null)" + "replyWithEmbedOrMessageDefinition: EmbedOrMessageDefinition(title=20 ⇒ 20, descriptionOrContent=, fields=[EmbedOrMessageDefinition.Field(name=Warning, value=did not contain any random element, try for Example `d20` to roll a 20 sided die, inline=false)], componentRowDefinitions=[], hasImage=false, type=EMBED, userReference=true, sendToOtherChannelId=null)" ] ] diff --git a/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandTest.java b/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandTest.java index 865a735b..dcf71637 100644 --- a/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandTest.java +++ b/bot/src/test/java/de/janno/discord/bot/command/directRoll/DirectRollCommandTest.java @@ -64,7 +64,7 @@ void handleComponentInteractEvent_validationFailed() { when(slashEventAdaptor.getOption(any())).thenReturn(Optional.of(interactionOption)); when(slashEventAdaptor.reply(any(), anyBoolean())).thenReturn(Mono.just(mock(Void.class))); when(slashEventAdaptor.getCommandString()).thenReturn("/r expression:asdfasdf"); - when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH)); + when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH, null)); Mono res = underTest.handleSlashCommandEvent(slashEventAdaptor, () -> UUID.fromString("00000000-0000-0000-0000-000000000000"), Locale.ENGLISH); @@ -97,7 +97,7 @@ void handleComponentInteractEvent_help() { when(slashEventAdaptor.getChannelId()).thenReturn(1L); when(slashEventAdaptor.replyWithEmbedOrMessageDefinition(any(), anyBoolean())).thenReturn(Mono.just(mock(Void.class))); when(slashEventAdaptor.getCommandString()).thenReturn("/r expression:help"); - when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH)); + when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH, null)); Mono res = underTest.handleSlashCommandEvent(slashEventAdaptor, () -> UUID.fromString("00000000-0000-0000-0000-000000000000"), Locale.ENGLISH); diff --git a/bot/src/test/java/de/janno/discord/bot/command/directRoll/ValidationCommandTest.java b/bot/src/test/java/de/janno/discord/bot/command/directRoll/ValidationCommandTest.java index ff133976..d4312de0 100644 --- a/bot/src/test/java/de/janno/discord/bot/command/directRoll/ValidationCommandTest.java +++ b/bot/src/test/java/de/janno/discord/bot/command/directRoll/ValidationCommandTest.java @@ -88,7 +88,7 @@ void handleComponentInteractEvent_validationFailed() { when(slashEventAdaptor.getOption(any())).thenReturn(Optional.of(interactionOption)); when(slashEventAdaptor.reply(any(), anyBoolean())).thenReturn(Mono.just(mock(Void.class))); when(slashEventAdaptor.getCommandString()).thenReturn("/r expression:asdfasdf"); - when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH)); + when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH, null)); Mono res = underTest.handleSlashCommandEvent(slashEventAdaptor, () -> UUID.fromString("00000000-0000-0000-0000-000000000000"), Locale.ENGLISH); @@ -120,7 +120,7 @@ void handleComponentInteractEvent_help() { when(slashEventAdaptor.getChannelId()).thenReturn(1L); when(slashEventAdaptor.replyWithEmbedOrMessageDefinition(any(), anyBoolean())).thenReturn(Mono.just(mock(Void.class))); when(slashEventAdaptor.getCommandString()).thenReturn("/r expression:help"); - when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH)); + when(slashEventAdaptor.getRequester()).thenReturn(new Requester("user", "channel", "guild", "[0 / 1]", Locale.ENGLISH, null)); Mono res = underTest.handleSlashCommandEvent(slashEventAdaptor, () -> UUID.fromString("00000000-0000-0000-0000-000000000000"), Locale.ENGLISH); diff --git a/discord-connector/api/src/main/java/de/janno/discord/connector/api/Requester.java b/discord-connector/api/src/main/java/de/janno/discord/connector/api/Requester.java index 07ed57b4..e71e889d 100644 --- a/discord-connector/api/src/main/java/de/janno/discord/connector/api/Requester.java +++ b/discord-connector/api/src/main/java/de/janno/discord/connector/api/Requester.java @@ -2,22 +2,32 @@ import lombok.Value; +import javax.annotation.Nullable; import java.util.Locale; import java.util.Optional; +import java.util.UUID; @Value public class Requester { String userName; + @Nullable String channelName; + @Nullable String guildName; String shard; + @Nullable Locale userLocal; - + @Nullable + UUID configUUID; public String toLogString() { - return Optional.ofNullable(guildName) + String name = Optional.ofNullable(guildName) .or(() -> Optional.ofNullable(channelName)) .or(() -> Optional.ofNullable(userName)) .orElse(""); + if (configUUID != null) { + return "%s:%s".formatted(configUUID, name); + } + return name; } } diff --git a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/ButtonEventAdapterImpl.java b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/ButtonEventAdapterImpl.java index 6dc7d89f..44d79472 100644 --- a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/ButtonEventAdapterImpl.java +++ b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/ButtonEventAdapterImpl.java @@ -178,7 +178,7 @@ public Optional checkPermissions(Long answerTargetChannelId, @NonNull Lo } @Override - protected @NonNull String getGuildAndChannelName() { + protected @NonNull String getErrorRequester() { return requester.toLogString(); } diff --git a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/DiscordAdapterImpl.java b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/DiscordAdapterImpl.java index 61be8cdf..a6b04053 100644 --- a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/DiscordAdapterImpl.java +++ b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/DiscordAdapterImpl.java @@ -145,7 +145,7 @@ protected Mono replyWithEmbedOrMessageDefinition( switch (messageDefinition.getType()) { case EMBED -> { //reply don't need avatar and name, they are already displayed - EmbedBuilder builder = convertToEmbedMessage(messageDefinition, null, null, rollRequesterId); + EmbedBuilder builder = convertToEmbedMessage(messageDefinition, null, null, rollRequesterId); final List files = applyFiles(builder, messageDefinition); return createMonoFrom(() -> event.replyEmbeds(builder.build()).setComponents(layoutComponents).setEphemeral(ephemeral).setFiles(files).setSuppressedNotifications(true)) .onErrorResume(t -> handleException("Error on replay embed message", t, false).ofType(InteractionHook.class)); @@ -172,23 +172,23 @@ protected Mono handleException(@NonNull String errorMessage, boolean ignoreNotFound) { switch (throwable) { case InsufficientPermissionException ignored -> { - log.info("{}: Missing permissions: {} - {}", getGuildAndChannelName(), errorMessage, throwable.getMessage()); + log.info("{}: Missing permissions: {} - {}", getErrorRequester(), errorMessage, throwable.getMessage()); return Mono.empty(); } case ErrorResponseException ignored when ((ErrorResponseException) throwable).getErrorResponse() == ErrorResponse.MISSING_PERMISSIONS -> { - log.info("{}: Missing permissions: {} - {}", getGuildAndChannelName(), errorMessage, throwable.getMessage()); + log.info("{}: Missing permissions: {} - {}", getErrorRequester(), errorMessage, throwable.getMessage()); return Mono.empty(); } //we can check if the emoji exists, so the error is simply cached case ErrorResponseException ignored when ((ErrorResponseException) throwable).getSchemaErrors().stream() .flatMap(se -> se.getErrors().stream()) .anyMatch(e -> "BUTTON_COMPONENT_INVALID_EMOJI".equals(e.getCode())) -> { - log.info("{}: Invalid emoji: {}", getGuildAndChannelName(), errorMessage); + log.info("{}: Invalid emoji: {}", getErrorRequester(), errorMessage); return Mono.empty(); } case ErrorResponseException ignored when ((ErrorResponseException) throwable).getErrorResponse().getCode() < 20000 && ignoreNotFound -> - log.trace("{}: Not found: {}", getGuildAndChannelName(), errorMessage); - default -> log.error("{}: {}", getGuildAndChannelName(), errorMessage, throwable); + log.trace("{}: Not found: {}", getErrorRequester(), errorMessage); + default -> log.error("{}: {}", getErrorRequester(), errorMessage, throwable); } return Mono.empty(); } @@ -264,7 +264,7 @@ protected Optional checkPermission(@NonNull MessageChannel messageChanne String result = I18n.getMessage("permission.missing", userLocale, String.join(", ", checks)); log.info(String.format("'%s'.'%s': %s", - Optional.of(guild).map(Guild::getName).orElse("-"), + getErrorRequester(), messageChannel.getName(), result)); return Optional.of(result); @@ -278,7 +278,7 @@ protected Optional checkPermission(@NonNull MessageChannel messageChanne protected abstract @NonNull MessageChannel getMessageChannel(); - protected abstract @NonNull String getGuildAndChannelName(); + protected abstract @NonNull String getErrorRequester(); protected @NonNull ParallelFlux getMessagesState(@NonNull MessageChannel messageChannel, @NonNull Collection messageIds) { return Flux.fromIterable(messageIds) diff --git a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/JdaClient.java b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/JdaClient.java index 4ca11839..6986a7ba 100644 --- a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/JdaClient.java +++ b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/JdaClient.java @@ -137,9 +137,10 @@ public void onCommandAutoCompleteInteraction(@NonNull CommandAutoCompleteInterac event.getChannel().getName(), Optional.ofNullable(event.getInteraction().getGuild()).map(Guild::getName).orElse(""), event.getJDA().getShardInfo().getShardString(), - userLocale); + userLocale, + null); if (matchingHandler.size() != 1) { - log.error("{}: Invalid handler for {} -> {}", requester, event.getInteraction().getCommandId(), matchingHandler.stream().map(SlashCommand::getCommandId).toList()); + log.error("{}: Invalid handler for {} -> {}", requester.toLogString(), event.getInteraction().getCommandId(), matchingHandler.stream().map(SlashCommand::getCommandId).toList()); } else { Mono.just(matchingHandler.getFirst()) .map(command -> command.getAutoCompleteAnswer(fromEvent(event), LocaleConverter.toLocale(event.getUserLocale()), event.getChannel().getIdLong(), event.getUser().getIdLong())) @@ -176,9 +177,10 @@ public void onSlashCommandInteraction(@NonNull SlashCommandInteractionEvent even event.getChannel().getName(), Optional.ofNullable(event.getInteraction().getGuild()).map(Guild::getName).orElse(""), event.getJDA().getShardInfo().getShardString(), - userLocale); + userLocale, + null); if (matchingHandler.size() != 1) { - log.error("{}: Invalid handler for {} -> {}", requester, event.getInteraction().getCommandId(), matchingHandler.stream().map(SlashCommand::getCommandId).toList()); + log.error("{}: Invalid handler for {} -> {}", requester.toLogString(), event.getInteraction().getCommandId(), matchingHandler.stream().map(SlashCommand::getCommandId).toList()); } else { Mono.just(matchingHandler.getFirst()) .flatMap(command -> { @@ -211,9 +213,10 @@ public void onButtonInteraction(@NonNull ButtonInteractionEvent event) { event.getChannel().getName(), Optional.ofNullable(event.getInteraction().getGuild()).map(Guild::getName).orElse(""), event.getJDA().getShardInfo().getShardString(), - userLocale); + userLocale, + BottomCustomIdUtils.getConfigUUIDFromCustomId(event.getInteraction().getComponentId()).orElse(null)); if (matchingHandler.size() != 1) { - log.error("{}: Invalid handler for {} -> {}", requester, event.getInteraction().getComponentId(), matchingHandler.stream().map(ComponentInteractEventHandler::getCommandId).toList()); + log.error("{}: Invalid handler for {} -> {}", requester.toLogString(), event.getInteraction().getComponentId(), matchingHandler.stream().map(ComponentInteractEventHandler::getCommandId).toList()); } else { Mono.just(matchingHandler.getFirst()) .flatMap(command -> { @@ -221,7 +224,7 @@ public void onButtonInteraction(@NonNull ButtonInteractionEvent event) { return command.handleComponentInteractEvent(new ButtonEventAdapterImpl(event, requester)); }) .onErrorResume(e -> { - log.error("ButtonInteractEvent Exception: ", e); + log.error("{} - ButtonInteractEvent Exception: ", requester.toLogString(), e); return Mono.empty(); }) .subscribeOn(scheduler) diff --git a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashCommandRegistry.java b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashCommandRegistry.java index ab8fd66d..43697e70 100644 --- a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashCommandRegistry.java +++ b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashCommandRegistry.java @@ -1,6 +1,7 @@ package de.janno.discord.connector.jda; import de.janno.discord.connector.api.SlashCommand; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.interactions.commands.Command; @@ -15,6 +16,7 @@ import java.util.function.Function; import java.util.stream.Collectors; +@Getter @Slf4j public class SlashCommandRegistry { @@ -28,10 +30,6 @@ public static Builder builder() { return new Builder(); } - public List getSlashCommands() { - return slashCommands; - } - public static class Builder { private final List slashCommands = new ArrayList<>(); diff --git a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashEventAdapterImpl.java b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashEventAdapterImpl.java index d7c44475..fd0be452 100644 --- a/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashEventAdapterImpl.java +++ b/discord-connector/jda/src/main/java/de/janno/discord/connector/jda/SlashEventAdapterImpl.java @@ -148,7 +148,7 @@ public long getUserId() { } @Override - protected @NonNull String getGuildAndChannelName() { + protected @NonNull String getErrorRequester() { return requester.toLogString(); }