V4+
This commit is contained in:
parent
63ba3694d3
commit
ad181c4cc0
@ -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
|
||||
}
|
||||
14
index.js
14
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... 🔊');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user