From d40527d0a2d9f209905750258f71bedff1cdf089 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:31:09 -0400 Subject: turned on ts strict option --- src/listeners/client/interactionCreate.ts | 6 +++++- src/listeners/client/ready.ts | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/listeners/client') diff --git a/src/listeners/client/interactionCreate.ts b/src/listeners/client/interactionCreate.ts index e719517..2c1ab68 100644 --- a/src/listeners/client/interactionCreate.ts +++ b/src/listeners/client/interactionCreate.ts @@ -17,7 +17,11 @@ export default class InteractionCreateListener extends BushListener { void client.console.info( 'SlashCommand', `The <<${interaction.commandName}>> command was used by <<${interaction.user.tag}>> in <<${ - interaction.channel.type == 'DM' ? interaction.channel.recipient + 's DMs' : interaction.channel.name + interaction.channel + ? interaction.channel.type == 'DM' + ? interaction.channel.recipient + 's DMs' + : interaction.channel.name + : 'unknown' }>>.` ); return; diff --git a/src/listeners/client/ready.ts b/src/listeners/client/ready.ts index 39e583b..89c9161 100644 --- a/src/listeners/client/ready.ts +++ b/src/listeners/client/ready.ts @@ -10,7 +10,7 @@ export default class ReadyListener extends BushListener { } public override async exec(): Promise { - const tag = `<<${client.user.tag}>>`, + const tag = `<<${client.user?.tag}>>`, guildCount = `<<${client.guilds.cache.size.toLocaleString()}>>`, userCount = `<<${client.users.cache.size.toLocaleString()}>>`; @@ -22,5 +22,14 @@ export default class ReadyListener extends BushListener { }` ) ); + + setTimeout( + // eslint-disable-next-line @typescript-eslint/no-misused-promises + async () => + await client.application?.commands + .create({ name: 'View Raw', type: 'MESSAGE' }) + .catch((e) => client.console.error(`Ready`, e?.stack ?? e)), + 2_000 + ); } } -- cgit