aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-07-07 20:40:24 +0200
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-07-07 20:40:24 +0200
commitcc7e2d625222260f0ba0176af7a9d8435b56254e (patch)
treed51cd7247fb0885bc43d86499d0977b2f82a7056 /src/commands
parent3b229fecbd71ac98bf17bb7a41bcb53cbbc5510c (diff)
downloadtanzanite-cc7e2d625222260f0ba0176af7a9d8435b56254e.tar.gz
tanzanite-cc7e2d625222260f0ba0176af7a9d8435b56254e.tar.bz2
tanzanite-cc7e2d625222260f0ba0176af7a9d8435b56254e.zip
improve steal command formatting
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/utilities/steal.ts25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/commands/utilities/steal.ts b/src/commands/utilities/steal.ts
index 83ec338..3741d27 100644
--- a/src/commands/utilities/steal.ts
+++ b/src/commands/utilities/steal.ts
@@ -3,6 +3,7 @@ import {
BushCommand,
clientSendAndPermCheck,
emojis,
+ format,
OptArgType,
regex,
type CommandMessage,
@@ -96,7 +97,7 @@ export default class StealCommand extends BushCommand {
? args.name ?? args.emoji.name ?? 'stolen_emoji'
: 'stolen_emoji';
- const creationSuccess = await message.guild.emojis
+ const res = await message.guild.emojis
.create({
attachment: image,
name: emojiName,
@@ -104,10 +105,12 @@ export default class StealCommand extends BushCommand {
})
.catch((e: Error) => e);
- if (!(creationSuccess instanceof Error))
- return await message.util.reply(`${emojis.success} You successfully stole ${creationSuccess}.`);
- else {
- return await message.util.reply(`${emojis.error} The was an error stealing that emoji \`${creationSuccess.message}\`.`);
+ if (!(res instanceof Error)) {
+ return await message.util.reply(
+ `${emojis.success} You successfully stole ${res} (${format.input(res.name ?? '[emoji has no name]')}).`
+ );
+ } else {
+ return await message.util.reply(`${emojis.error} The was an error stealing that emoji: ${format.input(res.message)}.`);
}
}
@@ -127,7 +130,7 @@ export default class StealCommand extends BushCommand {
}) as Promise<string>)
: args.emoji.attachment;
- const creationSuccess = await message.guild.emojis
+ const res = await message.guild.emojis
.create({
attachment: data,
name: name,
@@ -135,10 +138,12 @@ export default class StealCommand extends BushCommand {
})
.catch((e: Error) => e);
- if (!(creationSuccess instanceof Error))
- return await message.util.reply(`${emojis.success} You successfully stole ${creationSuccess}.`);
- else {
- return await message.util.reply(`${emojis.error} The was an error stealing that emoji \`${creationSuccess.message}\`.`);
+ if (!(res instanceof Error)) {
+ return await message.util.reply(
+ `${emojis.success} You successfully stole ${res} (${format.input(res.name ?? '[emoji has no name]')}).`
+ );
+ } else {
+ return await message.util.reply(`${emojis.error} The was an error stealing that emoji: ${format.input(res.message)}.`);
}
}
}