aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/client
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-17 12:31:09 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-17 12:31:09 -0400
commitd40527d0a2d9f209905750258f71bedff1cdf089 (patch)
treee017fd844c2135bfc85228d00ef2617d24ce0a3f /src/listeners/client
parentd431ad00754f3f250103deedea495b9bcee73fc0 (diff)
downloadtanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz
tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2
tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip
turned on ts strict option
Diffstat (limited to 'src/listeners/client')
-rw-r--r--src/listeners/client/interactionCreate.ts6
-rw-r--r--src/listeners/client/ready.ts11
2 files changed, 15 insertions, 2 deletions
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<void> {
- 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
+ );
}
}