aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-03-03 23:45:16 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-03-03 23:45:16 -0500
commit3c56bbcf795725b65192409b3211d92c097f8c82 (patch)
tree472dafca0224e61aeaffcf59ea176c534b8c3930 /src/commands/dev
parent2e02220de1d1de24375db11f22b4c6626c930a28 (diff)
downloadtanzanite-3c56bbcf795725b65192409b3211d92c097f8c82.tar.gz
tanzanite-3c56bbcf795725b65192409b3211d92c097f8c82.tar.bz2
tanzanite-3c56bbcf795725b65192409b3211d92c097f8c82.zip
refactor: preemptively switch addField to addFields
Diffstat (limited to 'src/commands/dev')
-rw-r--r--src/commands/dev/eval.ts10
-rw-r--r--src/commands/dev/javascript.ts8
-rw-r--r--src/commands/dev/sh.ts10
-rw-r--r--src/commands/dev/test.ts2
4 files changed, 15 insertions, 15 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index a6221c9..8742246 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -254,8 +254,8 @@ export default class EvalCommand extends BushCommand {
embed.setTimestamp();
- if (inputTS) embed.addField({ name: ':inbox_tray: Input (typescript)', value: inputTS });
- embed.addField({ name: `:inbox_tray: Input${inputTS ? ' (transpiled javascript)' : ''}`, value: inputJS });
+ if (inputTS) embed.addFields({ name: ':inbox_tray: Input (typescript)', value: inputTS });
+ embed.addFields({ name: `:inbox_tray: Input${inputTS ? ' (transpiled javascript)' : ''}`, value: inputJS });
const output = await this.codeblock(rawResult, 'js', {
depth: selDepth ?? 0,
@@ -270,10 +270,10 @@ export default class EvalCommand extends BushCommand {
embed
.setTitle(`${emojis[err ? 'errorFull' : 'successFull']} ${err ? 'Uns' : 'S'}uccessfully Evaluated Expression`)
.setColor(colors[err ? 'error' : 'success'])
- .addField({ name: `:outbox_tray: ${err ? 'Error' : 'Output'}`, value: output });
+ .addFields({ name: `:outbox_tray: ${err ? 'Error' : 'Output'}`, value: output });
- if (!err && methods) embed.addField({ name: ':wrench: Methods', value: methods });
- if (!err && proto) embed.addField({ name: ':gear: Proto', value: proto });
+ if (!err && methods) embed.addFields({ name: ':wrench: Methods', value: methods });
+ if (!err && proto) embed.addFields({ name: ':gear: Proto', value: proto });
if (!silent || message.util.isSlashMessage(message)) {
await message.util.reply({ content: null, embeds: [embed] });
diff --git a/src/commands/dev/javascript.ts b/src/commands/dev/javascript.ts
index 3ede3e2..b0ba0c4 100644
--- a/src/commands/dev/javascript.ts
+++ b/src/commands/dev/javascript.ts
@@ -67,12 +67,12 @@ export default class JavascriptCommand extends BushCommand {
});
embed.setTitle(`${util.emojis.successFull} Successfully Evaluated Expression`).setColor(util.colors.success);
- embed.addField({ name: '📥 Input', value: input });
- embed.addField({ name: '📤 Output', value: output });
+ embed.addFields({ name: '📥 Input', value: input });
+ embed.addFields({ name: '📤 Output', value: output });
} catch (e) {
embed.setTitle(`${util.emojis.errorFull} Unable to Evaluate Expression`).setColor(util.colors.error);
- embed.addField({ name: '📥 Input', value: input });
- embed.addField({ name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'js') });
+ embed.addFields({ name: '📥 Input', value: input });
+ embed.addFields({ name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'js') });
}
embed.setTimestamp().setFooter({ text: message.author.tag, iconURL: message.author.displayAvatarURL() ?? undefined });
diff --git a/src/commands/dev/sh.ts b/src/commands/dev/sh.ts
index 7d29df7..7134b6b 100644
--- a/src/commands/dev/sh.ts
+++ b/src/commands/dev/sh.ts
@@ -50,8 +50,8 @@ export default class ShCommand extends BushCommand {
.setFooter({ text: message.author.tag, iconURL: message.author.avatarURL() ?? undefined })
.setTimestamp()
.setTitle('Shell Command')
- .addField({ name: '📥 Input', value: await util.codeblock(input, 1024, 'sh', true) })
- .addField({ name: 'Running', value: util.emojis.loading });
+ .addFields({ name: '📥 Input', value: await util.codeblock(input, 1024, 'sh', true) })
+ .addFields({ name: 'Running', value: util.emojis.loading });
await message.util.reply({ embeds: [embed] });
@@ -72,15 +72,15 @@ export default class ShCommand extends BushCommand {
.setColor(util.colors.success)
.spliceFields(1, 1);
- if (stdout) embed.addField({ name: '📤 stdout', value: await util.codeblock(stdout, 1024, 'json', true) });
- if (stderr) embed.addField({ name: '📤 stderr', value: await util.codeblock(stderr, 1024, 'json', true) });
+ if (stdout) embed.addFields({ name: '📤 stdout', value: await util.codeblock(stdout, 1024, 'json', true) });
+ if (stderr) embed.addFields({ name: '📤 stderr', value: await util.codeblock(stderr, 1024, 'json', true) });
} catch (e) {
embed
.setTitle(`${util.emojis.errorFull} An error occurred while executing.`)
.setColor(util.colors.error)
.spliceFields(1, 1);
- embed.addField({ name: '📤 Output', value: await util.codeblock(e?.stack, 1024, 'js', true) });
+ embed.addFields({ name: '📤 Output', value: await util.codeblock(e?.stack, 1024, 'js', true) });
}
await message.util.edit({ embeds: [embed] });
}
diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts
index 8c76ded..cca40a6 100644
--- a/src/commands/dev/test.ts
+++ b/src/commands/dev/test.ts
@@ -63,7 +63,7 @@ export default class TestCommand extends BushCommand {
return await message.util.reply({ content: 'buttons', components: [ButtonRow] });
} else if (['embed', 'button embed'].includes(args?.feature?.toLowerCase())) {
const embed = new Embed()
- .addField({ name: 'Field Name', value: 'Field Content' })
+ .addFields({ name: 'Field Name', value: 'Field Content' })
.setAuthor({ name: 'Author', iconURL: 'https://www.w3schools.com/w3css/img_snowtops.jpg', url: 'https://google.com/' })
.setColor(message.member?.displayColor ?? util.colors.default)
.setDescription('Description')