small eval fixes

This commit is contained in:
derpystuff 2023-06-12 22:33:11 +02:00
parent 6628fc3233
commit 7f614ffac1

View file

@ -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) {