From 124d1e130a3a771c2ca0a923e56bd9e8f57275a2 Mon Sep 17 00:00:00 2001 From: Ren Adachi <49895682+moeyashi@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:25:23 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=83=AD=E3=82=B0=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ren Adachi <49895682+moeyashi@users.noreply.github.com> --- src/event/interaction-create.js | 1 + src/event/ready.js | 5 ++++- src/main.js | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/event/interaction-create.js b/src/event/interaction-create.js index c72d895..8afe82f 100644 --- a/src/event/interaction-create.js +++ b/src/event/interaction-create.js @@ -17,6 +17,7 @@ const getCommands = async () => { export default { name: Events.InteractionCreate, async execute(nitaRepository, interaction) { + console.info('InteractionCreate event triggered!'); if (!interaction.isChatInputCommand()) return; const commands = await getCommands(); diff --git a/src/event/ready.js b/src/event/ready.js index b4039a0..9817db7 100644 --- a/src/event/ready.js +++ b/src/event/ready.js @@ -6,7 +6,10 @@ export default { name: Events.ClientReady, once: true, execute: (_, client) => { - if (!client.isReady()) return; + if (!client.isReady()) { + console.error('The client is not ready!'); + return; + } console.log(`Ready! Logged in as ${client.user.tag}`); }, }; diff --git a/src/main.js b/src/main.js index 2453150..b6c06bc 100644 --- a/src/main.js +++ b/src/main.js @@ -35,8 +35,13 @@ const main = async () => { } console.info('Loaded events!'); - // Log in to Discord with your client's token - await client.login(process.env.DISCORD_BOT_TOKEN); + try { + // Log in to Discord with your client's token + await client.login(process.env.DISCORD_BOT_TOKEN); + console.info('Logged in to Discord!'); + } catch (error) { + console.error(`Failed to log in to Discord. ${error}`); + } }; main();