From 7f614ffac123c44888ea0379ee8a9bb4408fa2f1 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Mon, 12 Jun 2023 22:33:11 +0200 Subject: [PATCH] small eval fixes --- commands/message/utils/eval.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/message/utils/eval.js b/commands/message/utils/eval.js index b8efa96..5407375 100644 --- a/commands/message/utils/eval.js +++ b/commands/message/utils/eval.js @@ -14,7 +14,7 @@ module.exports = { label: 'code', name: 'eval', metadata: { - description: `Evaluate code snippets.\nSupported languages: ${highlight(Object.keys(REXTESTER_LANGUAGES).join(', '))}`, + description: `Evaluate code snippets. Supports codeblocks.\n\nSupported languages: ${highlight(Object.keys(REXTESTER_LANGUAGES).join(', '))}`, description_short: 'Evaluate code', examples: ['eval console.log(\'hi\') -lang js'], category: 'utils', @@ -26,6 +26,8 @@ module.exports = { run: async (context, args) => { context.triggerTyping(); + if(!args.code) return editOrReply(context, createEmbed("warning", context, "No code provided.")) + const { matches } = Utils.regex(DiscordRegexNames.TEXT_CODEBLOCK, args.code); if (matches.length) {