update interaction error message
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m6s

This commit is contained in:
Lee 2024-07-05 23:35:41 +01:00
parent 07c5a7358b
commit ec54d5427e

@ -48,25 +48,26 @@ public class EmbedUtils {
/** /**
* Builds a generic interaction error embed * Builds a generic interaction error embed
* *
* @param ex the exception * @param ex the exceptionk
* @return the embed builder * @return the embed builder
*/ */
public static EmbedBuilder genericInteractionError(Exception ex) { public static EmbedBuilder genericInteractionError(Exception ex) {
TextChannel channel = ChannelUtils.getTextChannel(Config.INSTANCE.getLogsChannel()); TextChannel channel = ChannelUtils.getTextChannel(Config.INSTANCE.getLogsChannel());
if (channel != null) { EmbedBuilder embed = errorEmbed()
channel.sendMessageEmbeds(EmbedUtils.errorEmbed()
.setDescription("""
An error has occurred while processing an interaction. Please check the logs for more information.
```java
%s
```""".formatted(ex.getLocalizedMessage()))
.build()).queue();
}
return EmbedUtils.errorEmbed()
.setDescription(""" .setDescription("""
An error has occurred while processing your interaction. Please check the logs for more information. An error has occurred while processing %s interaction. If this issue persists, please contact the developers.
```java Cause: `%s`
%s ```java
```""".formatted(ex.getLocalizedMessage())); %s
```""".formatted(
channel == null ? "an" : "your",
ex.getStackTrace()[0].getClassName(),
ex.getLocalizedMessage()
));
if (channel != null) {
channel.sendMessageEmbeds(embed.build()).queue();
}
return embed;
} }
} }