diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-07 20:40:24 +0200 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-07 20:40:24 +0200 |
commit | cc7e2d625222260f0ba0176af7a9d8435b56254e (patch) | |
tree | d51cd7247fb0885bc43d86499d0977b2f82a7056 /src/commands/utilities/steal.ts | |
parent | 3b229fecbd71ac98bf17bb7a41bcb53cbbc5510c (diff) | |
download | tanzanite-cc7e2d625222260f0ba0176af7a9d8435b56254e.tar.gz tanzanite-cc7e2d625222260f0ba0176af7a9d8435b56254e.tar.bz2 tanzanite-cc7e2d625222260f0ba0176af7a9d8435b56254e.zip |
improve steal command formatting
Diffstat (limited to 'src/commands/utilities/steal.ts')
-rw-r--r-- | src/commands/utilities/steal.ts | 25 |
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)}.`); } } } |