aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/decode.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/utilities/decode.ts')
-rw-r--r--src/commands/utilities/decode.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/commands/utilities/decode.ts b/src/commands/utilities/decode.ts
index 05e988a..a5a4c21 100644
--- a/src/commands/utilities/decode.ts
+++ b/src/commands/utilities/decode.ts
@@ -99,16 +99,14 @@ export default class DecodeCommand extends BushCommand {
const encodeOrDecode = util.capitalizeFirstLetter(message?.util?.parsed?.alias || 'decoded');
const decodedEmbed = new MessageEmbed()
.setTitle(`${encodeOrDecode} Information`)
- .addField('📥 Input', await util.inspectCleanRedactCodeblock(data, undefined));
+ .addField('📥 Input', await util.inspectCleanRedactCodeblock(data));
try {
const decoded = Buffer.from(data, from).toString(to);
- decodedEmbed
- .setColor(util.colors.success)
- .addField('📤 Output', await util.inspectCleanRedactCodeblock(decoded, undefined));
+ decodedEmbed.setColor(util.colors.success).addField('📤 Output', await util.inspectCleanRedactCodeblock(decoded));
} catch (error) {
decodedEmbed
.setColor(util.colors.error)
- .addField(`📤 Error ${encodeOrDecode.slice(1)}ing`, await util.inspectCleanRedactCodeblock(error.stack, undefined));
+ .addField(`📤 Error ${encodeOrDecode.slice(1)}ing`, await util.inspectCleanRedactCodeblock(error?.stack ?? error));
}
return await message.util.reply({ embeds: [decodedEmbed], allowedMentions: AllowedMentions.none() });
}