From 50d658114130f4001bc7d94a8a0d74d925cf05b5 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Mon, 24 Feb 2025 00:39:58 +0100 Subject: [PATCH] fix backend-provided error messages on wolfram --- commands/interaction/slash/search/wolfram-alpha.js | 2 +- commands/message/search/wolfram-alpha.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/interaction/slash/search/wolfram-alpha.js b/commands/interaction/slash/search/wolfram-alpha.js index 8585024..5f5803b 100644 --- a/commands/interaction/slash/search/wolfram-alpha.js +++ b/commands/interaction/slash/search/wolfram-alpha.js @@ -86,7 +86,7 @@ module.exports = { pages: formatPaginationEmbeds(pages) }); } catch (e) { - if(e.response.body?.error) return editOrReply(context, createEmbed("warning", context, e.response.body.error.message)) + if(e.response.body?.error) return editOrReply(context, createEmbed("warning", context, e.response.body.message)) console.log(e) return editOrReply(context, createEmbed("error", context, `Unable to perform Wolfram|Alpha search.`)) } diff --git a/commands/message/search/wolfram-alpha.js b/commands/message/search/wolfram-alpha.js index 0f105b1..c079bb2 100644 --- a/commands/message/search/wolfram-alpha.js +++ b/commands/message/search/wolfram-alpha.js @@ -119,7 +119,7 @@ module.exports = { } }); } catch (e) { - if(e.response.body?.error) return editOrReply(context, createEmbed("warning", context, e.response.body.error.message)) + if(e.response.body?.error) return editOrReply(context, createEmbed("warning", context, e.response.body.message)) console.log(e) return editOrReply(context, createEmbed("error", context, `Unable to perform Wolfram|Alpha search.`)) }