diff --git a/data/config.json b/data/config.json index 70dac7d..fd66921 100644 --- a/data/config.json +++ b/data/config.json @@ -2,6 +2,6 @@ "discord_token": "MTQ3MTkwOTE5Mzg4Njg1OTI5NA.GCEdpc.jMIxPFsquVAhp88x3dO-yWUFI7e1u1r8oIZTcw", "guild_id": "1428530728706117632", "voice_channel_id": "1457687430189682781", - "alarm_time": "05:46", + "alarm_time": "09:05", "last_voice_channel": null } \ No newline at end of file diff --git a/index.js b/index.js index ee83d88..3a2a826 100644 --- a/index.js +++ b/index.js @@ -50,9 +50,13 @@ client.on('interactionCreate', async interaction => { channelId: channel.id, guildId: interaction.guildId, adapterCreator: interaction.guild.voiceAdapterCreator, - selfDeaf: false + selfDeaf: false, + selfMute: false }); + // Subscribe player immediately + connection.subscribe(player); + // Stay 24/7: Pastikan bot tidak disconnect connection.on(VoiceConnectionStatus.Disconnected, () => { console.log('Bot terputus dari voice channel.'); @@ -72,10 +76,12 @@ client.on('interactionCreate', async interaction => { if (!connection) return interaction.editReply('Bot belum join! Gunakan /join dulu.'); try { - // Audio Fix as requested - const resource = createAudioResource(join(__dirname, 'assets/audio/sahur.mp3')); - player.play(resource); + // Audio Fix as requested with Volume Booster + const resource = createAudioResource(join(__dirname, 'assets', 'audio', 'sahur.mp3'), { inlineVolume: true }); + resource.volume.setVolume(1.0); + connection.subscribe(player); + player.play(resource); // Edit Reply as requested await interaction.editReply('Memutar audio sahur... 🔊');