From 989cc90797d626c5aa998d18105ac7c6e9f02891 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 16 Feb 2026 16:25:35 +0000 Subject: [PATCH] V3 --- bot.log | 16 +++++++--------- data/config.json | 13 +++++-------- index.js | 8 +++++++- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/bot.log b/bot.log index f263edb..2e6d7c5 100644 --- a/bot.log +++ b/bot.log @@ -2,15 +2,13 @@ Interaction Error: DiscordAPIError[10062]: Unknown interaction at handleErrors (/home/ubuntu/executor/workspace/node_modules/@discordjs/rest/dist/index.js:762:13) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async BurstHandler.runRequest (/home/ubuntu/executor/workspace/node_modules/@discordjs/rest/dist/index.js:866:23) - at async _REST.request (/home/ubuntu/executor/workspace/node_modules/@discordjs/rest/dist/index.js:1307:22) - at async ChatInputCommandInteraction.reply (/home/ubuntu/executor/workspace/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:193:22) - at async Client. (/home/ubuntu/executor/workspace/index.js:68:13) { - requestBody: { files: [], json: { type: 4, data: [Object] } }, - rawError: { message: 'Unknown interaction', code: 10062 }, - code: 10062, - status: 404, - method: 'POST', - url: 'https://discord.com/api/v10/interactions/1472990887029248135/aW50ZXJhY3Rpb246MTQ3Mjk5MDg4NzAyOTI0ODEzNTp2V1dQTFpXN3IybjBtYmZNcjJxaW5qZnlBR1RQdVpKelhnYjdiRUtWQmI1YW9IbXpZS25WVzQzVVpEWVpSa2hVY3FlamhRYVdlaEt0dVlYRVI5bUNCMVM3bnNmUjZhbDBqZk1RdEhrYXB5R3p6VWZsbUNwQUl6RURGa3hkWEwzaw/callback?with_response=false' + at async _REST.request (/home/ubuntu/execVoice Connection Error: Error: No compatible encryption modes. Available include: aead_aes256_gcm_rtpsize, aead_xchacha20_poly1305_rtpsize + at chooseEncryptionMode (/home/ubuntu/executor/workspace/node_modules/@discordjs/voice/dist/index.js:529:11) + at /home/ubuntu/executor/workspace/node_modules/@discordjs/voice/dist/index.js:721:21 +Voice Connection Error: Error: No compatible encryption modes. Available include: aead_aes256_gcm_rtpsize, aead_xchacha20_poly1305_rtpsize + at chooseEncryptionMode (/home/ubuntu/executor/workspace/node_modules/@discordjs/voice/dist/index.js:529:11) + at /home/ubuntu/executor/workspace/node_modules/@discordjs/voice/dist/index.js:721:21 +3FlamhRYVdlaEt0dVlYRVI5bUNCMVM3bnNmUjZhbDBqZk1RdEhrYXB5R3p6VWZsbUNwQUl6RURGa3hkWEwzaw/callback?with_response=false' } (node:7629) Warning: Supplying "ephemeral" for interaction response options is deprecated. Utilize flags instead. (Use `node --trace-warnings ...` to show where the warning was created) diff --git a/data/config.json b/data/config.json index 6f1afe5..b08d715 100644 --- a/data/config.json +++ b/data/config.json @@ -1,10 +1,7 @@ { - "discord_token": "MTQ3MTkwOTE5Mzg4Njg1OTI5NA.GCEdpc.jMIxPFsquVAhp88x3dO-yWUFI7e1u1r8oIZTcw", - "guild_id": "1428530728706117632", - "voice_channel_id": "1457687430189682781", - "alarm_time": "23:20", - "last_voice_channel": { - "guildId": "1428530728706117632", - "channelId": "1457687430189682781" - } + "discord_token": "MTQ3MTkwOTE5Mzg4Njg1OTI5NA.GCEdpc.jMIxPFsquVAhp88x3dO-yWUFI7e1u1r8oIZTcw", + "guild_id": "1428530728706117632", + "voice_channel_id": "1457687430189682781", + "alarm_time": "23:27", + "last_voice_channel": null } \ No newline at end of file diff --git a/index.js b/index.js index 1cef16a..b127df3 100644 --- a/index.js +++ b/index.js @@ -33,6 +33,10 @@ const client = new Client({ const player = createAudioPlayer(); +player.on(AudioPlayerStatus.Idle, () => { + console.log('Audio finished playing. Bot will stay in the channel.'); +}); + player.on('error', error => { console.error('Audio Player Error:', error.message); }); @@ -83,6 +87,7 @@ function joinVC(gId, cId) { guildId: gId, adapterCreator: guild.voiceAdapterCreator, selfDeaf: false, + selfMute: false, }); connection.on(VoiceConnectionStatus.Disconnected, async () => { @@ -130,7 +135,8 @@ client.on('interactionCreate', async interaction => { return interaction.reply(`File audio tidak ditemukan: ${audioPath}`); } - const resource = createAudioResource(audioPath); + const resource = createAudioResource(audioPath, { inlineVolume: true }); + resource.volume.setVolume(1.0); player.play(resource); await interaction.reply('🔊 Memutar audio Sahur!');