diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
commit | d40527d0a2d9f209905750258f71bedff1cdf089 (patch) | |
tree | e017fd844c2135bfc85228d00ef2617d24ce0a3f /src/commands/utilities/viewraw.ts | |
parent | d431ad00754f3f250103deedea495b9bcee73fc0 (diff) | |
download | tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2 tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip |
turned on ts strict option
Diffstat (limited to 'src/commands/utilities/viewraw.ts')
-rw-r--r-- | src/commands/utilities/viewraw.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/commands/utilities/viewraw.ts b/src/commands/utilities/viewraw.ts index e783dec..f6be382 100644 --- a/src/commands/utilities/viewraw.ts +++ b/src/commands/utilities/viewraw.ts @@ -70,18 +70,21 @@ export default class ViewRawCommand extends BushCommand { return await message.util.reply({ embeds: [messageEmbed] }); } - public static async getRawData(message: BushMessage, options: { json?: boolean; js: boolean }): Promise<unknown> { + public static async getRawData(message: BushMessage, options: { json?: boolean; js: boolean }): Promise<MessageEmbed> { const content = options.json || options.js ? options.json ? inspect(JSON.stringify(message.toJSON())) : inspect(message.toJSON()) || '[No Content]' : message.content || '[No Content]'; - return new MessageEmbed() - .setFooter(message.author.tag, message.author.avatarURL({ dynamic: true })) - .setTimestamp(message.createdTimestamp) - .setColor(message.member?.roles?.color?.color || util.colors.default) - .setTitle('Raw Message Information') - .setDescription(await util.codeblock(content, 2048, 'js')); + return ( + new MessageEmbed() + .setFooter(message.author.tag, message.author.avatarURL({ dynamic: true }) ?? undefined) + .setTimestamp(message.createdTimestamp) + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + .setColor(message.member?.roles?.color?.color || util.colors.default) + .setTitle('Raw Message Information') + .setDescription(await util.codeblock(content, 2048, 'js')) + ); } } |