aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/sh.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-17 20:03:05 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-17 20:03:05 -0400
commite1c613829950a534d9f45c00a033b83575be3b3c (patch)
tree2de1e5231217211ae4087c46cc74dc46c584507a /src/commands/dev/sh.ts
parent0e87bbd3940d89defcb04926587b35c8f4d1947f (diff)
downloadtanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.gz
tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.bz2
tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.zip
remove global client variable
Diffstat (limited to 'src/commands/dev/sh.ts')
-rw-r--r--src/commands/dev/sh.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/commands/dev/sh.ts b/src/commands/dev/sh.ts
index f7c17bd..7ffdf27 100644
--- a/src/commands/dev/sh.ts
+++ b/src/commands/dev/sh.ts
@@ -2,7 +2,6 @@ import {
ArgType,
BushCommand,
clientSendAndPermCheck,
- codeblock,
colors,
emojis,
formatError,
@@ -51,7 +50,7 @@ export default class ShCommand extends BushCommand {
}
public override async exec(message: CommandMessage | SlashMessage, args: { command: ArgType<'string'> }) {
- if (!client.config.owners.includes(message.author.id))
+ if (!this.client.config.owners.includes(message.author.id))
return await message.util.reply(`${emojis.error} Only my developers can run this command.`);
const input = clean(args.command);
@@ -61,7 +60,7 @@ export default class ShCommand extends BushCommand {
.setTimestamp()
.setTitle('Shell Command')
.addFields([
- { name: '📥 Input', value: await codeblock(input, 1024, 'sh', true) },
+ { name: '📥 Input', value: await this.client.utils.codeblock(input, 1024, 'sh', true) },
{ name: 'Running', value: emojis.loading }
]);
@@ -81,12 +80,14 @@ export default class ShCommand extends BushCommand {
embed.setTitle(`${emojis.successFull} Executed command successfully.`).setColor(colors.success).spliceFields(1, 1);
- if (stdout) embed.addFields([{ name: '📤 stdout', value: await codeblock(stdout, 1024, 'ansi', true) }]);
- if (stderr) embed.addFields([{ name: '📤 stderr', value: await codeblock(stderr, 1024, 'ansi', true) }]);
+ if (stdout) embed.addFields([{ name: '📤 stdout', value: await this.client.utils.codeblock(stdout, 1024, 'ansi', true) }]);
+ if (stderr) embed.addFields([{ name: '📤 stderr', value: await this.client.utils.codeblock(stderr, 1024, 'ansi', true) }]);
} catch (e) {
embed.setTitle(`${emojis.errorFull} An error occurred while executing.`).setColor(colors.error).spliceFields(1, 1);
- embed.addFields([{ name: '📤 Output', value: await codeblock(formatError(e, true), 1024, 'ansi', true) }]);
+ embed.addFields([
+ { name: '📤 Output', value: await this.client.utils.codeblock(formatError(e, true), 1024, 'ansi', true) }
+ ]);
}
await message.util.edit({ embeds: [embed] });
}