From 0e42ce02fafeacd69a941664cde1e38b0258004b Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 17 Feb 2026 19:11:59 +0000 Subject: [PATCH] Autosave: 20260217-191159 --- bot.log | 2 +- index.js | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bot.log b/bot.log index fae7d9a..c6562b9 100644 --- a/bot.log +++ b/bot.log @@ -3,6 +3,6 @@ Bot Starting... Keep-Alive aktif di port 8080 Bot logged in as XiaoMao#2565 Memulai refresh slash commands... -(node:20219) DeprecationWarning: The ready event has been renamed to clientReady to distinguish it from the gateway READY event and will only emit under that name in v15. Please use clientReady instead. +(node:20667) DeprecationWarning: The ready event has been renamed to clientReady to distinguish it from the gateway READY event and will only emit under that name in v15. Please use clientReady instead. (Use `node --trace-deprecation ...` to show where the warning was created) Berhasil mendaftarkan slash commands! diff --git a/index.js b/index.js index 5b378e7..f204208 100644 --- a/index.js +++ b/index.js @@ -60,15 +60,13 @@ const commands = [ // 5. Interaction Handling client.on('interactionCreate', async interaction => { + await interaction.deferReply().catch(e => console.error(e)); + console.log('--- COMMAND DITERIMA: ' + interaction.commandName + ' ---'); if (!interaction.isChatInputCommand()) return; const { commandName } = interaction; if (commandName === 'play') { - // PRIORITAS UTAMA: Defer secepat mungkin untuk menghindari timeout - await interaction.deferReply(); - console.log('Command diterima, sedang memproses...'); - try { const query = interaction.options.getString('query'); @@ -93,8 +91,6 @@ client.on('interactionCreate', async interaction => { } else { // Untuk command lain, kita tetap gunakan try-catch global try { - await interaction.deferReply(); - if (!interaction.member.voice.channel) { return interaction.editReply('Kamu harus berada di voice channel!'); } @@ -181,4 +177,4 @@ process.on('uncaughtException', error => { console.error('Uncaught exception:', error); }); -client.login(process.env.DISCORD_TOKEN); +client.login('MTQ3Mjc2ODQ4NTQ0NzY5NjY1MA.Gx78sk.NGDrdd51zwcDbqyVrupL78RlUZdUSgmGvzn3pw');