From 0e777bb95bccc1823d2a100bb3086616e7da0d0d Mon Sep 17 00:00:00 2001 From: srnyx <25808801+srnyx@users.noreply.github.com> Date: Sat, 31 Aug 2024 01:12:11 -0400 Subject: [PATCH] Add `LazyEmbed#unexepectedError(String)` --- .../java/xyz/srnyx/lazylibrary/LazyEmbed.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/xyz/srnyx/lazylibrary/LazyEmbed.java b/src/main/java/xyz/srnyx/lazylibrary/LazyEmbed.java index e744066..3b5b575 100644 --- a/src/main/java/xyz/srnyx/lazylibrary/LazyEmbed.java +++ b/src/main/java/xyz/srnyx/lazylibrary/LazyEmbed.java @@ -825,6 +825,22 @@ public static LazyEmbed unexpectedError() { .setDescription("An unexpected error occurred, please try again!\n*If the issue persists, please contact support*"); } + /** + * A pre-built {@link LazyEmbed} for when an unexpected error occurs + * + * @param error a short description of the error that occurred + * + * @return the {@link LazyEmbed} + */ + @NotNull + public static LazyEmbed unexpectedError(@NotNull String error) { + return new LazyEmbed() + .setColor(Color.RED) + .setTitle(LazyEmoji.WARNING_CLEAR + " Unexpected error!") + .setDescription("An unexpected error occurred, please try again!\n*If the issue persists, please contact support*") + .addField("Error", error, true); + } + /** * A pre-built {@link LazyEmbed} for when a user doesn't have permission to do something *