diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-25 23:47:40 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-25 23:47:40 -0500 |
commit | 840cca672d681c36f980a06fb79a4e2c01bd69ac (patch) | |
tree | 82c40a7fe3e1a2bc6367fed6e3d26b6c7dceb256 /src/commands/dev/eval.ts | |
parent | 6ca99336a416389dd2b0b8c4c6a7b2ef87bc9fef (diff) | |
download | tanzanite-840cca672d681c36f980a06fb79a4e2c01bd69ac.tar.gz tanzanite-840cca672d681c36f980a06fb79a4e2c01bd69ac.tar.bz2 tanzanite-840cca672d681c36f980a06fb79a4e2c01bd69ac.zip |
I love breaking changes!!!!
Diffstat (limited to 'src/commands/dev/eval.ts')
-rw-r--r-- | src/commands/dev/eval.ts | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index 92b1117..c8541c6 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -25,13 +25,13 @@ import { CommandInteraction, ContextMenuCommandInteraction, DMChannel, + Embed, Emoji, Interaction, InteractionCollector, Message, MessageAttachment, MessageCollector, - MessageEmbed, ReactionCollector, SelectMenuComponent, Util @@ -194,7 +194,7 @@ export default class EvalCommand extends BushCommand { lang: isTypescript ? 'ts' : 'js' }; - const embed = new MessageEmbed(); + const embed = new Embed(); const badPhrases = ['delete', 'destroy']; if (badPhrases.some((p) => code[code.lang]!.includes(p)) && !args.sudo) { @@ -233,16 +233,22 @@ export default class EvalCommand extends BushCommand { : undefined; embed.setTitle(`${emojis.successFull} Successfully Evaluated Expression`).setColor(colors.success); - if (inputTS) embed.addField('📥 Input (typescript)', inputTS).addField('📥 Input (transpiled javascript)', inputJS); - else embed.addField('📥 Input', inputJS); - embed.addField('📤 Output', output); - if (methods) embed.addField('🔧 Methods', methods); - if (proto) embed.addField('⚙️ Proto', proto); + if (inputTS) + embed + .addField({ name: '📥 Input (typescript)', value: inputTS }) + .addField({ name: '📥 Input (transpiled javascript)', value: inputJS }); + else embed.addField({ name: '📥 Input', value: inputJS }); + embed.addField({ name: '📤 Output', value: output }); + if (methods) embed.addField({ name: '🔧 Methods', value: methods }); + if (proto) embed.addField({ name: '⚙️ Proto', value: proto }); } catch (e) { embed.setTitle(`${emojis.errorFull} Unable to Evaluate Expression`).setColor(colors.error); - if (inputTS) embed.addField('📥 Input (typescript)', inputTS).addField('📥 Input (transpiled javascript)', inputJS); - else embed.addField('📥 Input', inputJS); - embed.addField('📤 Error', await util.inspectCleanRedactCodeblock(e, 'js')); + if (inputTS) + embed + .addField({ name: '📥 Input (typescript)', value: inputTS }) + .addField({ name: '📥 Input (transpiled javascript)', value: inputJS }); + else embed.addField({ name: '📥 Input', value: inputJS }); + embed.addField({ name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'js') }); } embed.setTimestamp().setFooter({ text: message.author.tag, iconURL: message.author.displayAvatarURL() ?? undefined }); |