diff --git a/bot/bot.log b/bot/bot.log index 708711b..b177d6d 100644 --- a/bot/bot.log +++ b/bot/bot.log @@ -391,3 +391,150 @@ Ready! Logged in as AsepXiaoQin#6954 FFMPEG Path: /home/ubuntu/executor/workspace/bot/node_modules/ffmpeg-static/ffmpeg [2026-02-16T08:21:42.574Z] Alarm scheduled at 30 3 * * * Alarm scheduled at 30 3 * * * +[2026-02-16T08:24:55.831Z] Playing local file independently: /home/ubuntu/executor/workspace/bot/assets/audio/sahur.mp3 +Playing local file independently: /home/ubuntu/executor/workspace/bot/assets/audio/sahur.mp3 +[2026-02-16T08:25:49.191Z] Fetching stream via DisTube for: https://on.soundcloud.com/ORjsl2DMlAGkmIXfel +Fetching stream via DisTube for: https://on.soundcloud.com/ORjsl2DMlAGkmIXfel +SyntaxError: Unexpected token 'D', "Deprecated"... is not valid JSON + at JSON.parse () + at ChildProcess. (/home/ubuntu/executor/workspace/bot/node_modules/@distube/yt-dlp/dist/index.js:84:36) + at ChildProcess.emit (node:events:518:28) + at maybeClose (node:internal/child_process:1101:16) + at Socket. (node:internal/child_process:456:11) + at Socket.emit (node:events:518:28) + at Pipe. (node:net:346:12) +[2026-02-16T08:25:57.742Z] Uncaught Exception: Unexpected token 'D', "Deprecated"... is not valid JSON +Uncaught Exception: Unexpected token 'D', "Deprecated"... is not valid JSON +SyntaxError: Unexpected token 'D', "Deprecated"... is not valid JSON + at JSON.parse () + at ChildProcess. (/home/ubuntu/executor/workspace/bot/node_modules/@distube/yt-dlp/dist/index.js:84:36) + at ChildProcess.emit (node:events:518:28) + at maybeClose (node:internal/child_process:1101:16) + at Socket. (node:internal/child_process:456:11) + at Socket.emit (node:events:518:28) + at Pipe. (node:net:346:12) +[2026-02-16T08:31:40.298Z] Fetching stream via DisTube for: bawa dia kembali +Fetching stream via DisTube for: bawa dia kembali +[dotenv@17.3.1] injecting env (4) from .env -- tip: ⚙️ suppress all logs with { quiet: true } +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: 🤖 agentic secret storage: https://dotenvx.com/as2 +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: 🤖 agentic secret storage: https://dotenvx.com/as2 +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: ⚙️ write to custom object with { processEnv: myObject } +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: ⚙️ enable debug logging with { debug: true } +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: ⚙️ suppress all logs with { quiet: true } +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit +DisTubeError [INVALID_KEY]: 'ffmpegPath' does not need to be provided in DisTubeOptions + at checkInvalidKey (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1288:25) + at new Options (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:1692:5) + at new DisTube (/home/ubuntu/executor/workspace/bot/node_modules/distube/dist/index.js:2281:20) + at Object. (/home/ubuntu/executor/workspace/bot/index.js:49:17) + at Module._compile (node:internal/modules/cjs/loader:1688:14) + at Object..js (node:internal/modules/cjs/loader:1820:10) + at Module.load (node:internal/modules/cjs/loader:1423:32) + at Function._load (node:internal/modules/cjs/loader:1246:12) + at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23) + at Module._compile (node:internal/modules/cjs/loader:1688:14) { + errorCode: 'INVALID_KEY' +} +[dotenv@17.3.1] injecting env (4) from .env -- tip: ⚡️ secrets for agents: https://dotenvx.com/as2 +[2026-02-16T08:36:43.578Z] Encryption library (libsodium) is ready. +Encryption library (libsodium) is ready. +[2026-02-16T08:36:46.294Z] Bot berhasil login! +[2026-02-16T08:36:46.295Z] Ready! Logged in as AsepXiaoQin#6954 +[2026-02-16T08:36:46.296Z] FFMPEG Path: /home/ubuntu/executor/workspace/bot/node_modules/ffmpeg-static/ffmpeg +Bot berhasil login! +Ready! Logged in as AsepXiaoQin#6954 +FFMPEG Path: /home/ubuntu/executor/workspace/bot/node_modules/ffmpeg-static/ffmpeg +[2026-02-16T08:36:47.798Z] Alarm scheduled at 30 3 * * * +Alarm scheduled at 30 3 * * * diff --git a/bot/index.js b/bot/index.js index ab66b38..9b304f6 100644 --- a/bot/index.js +++ b/bot/index.js @@ -3,6 +3,7 @@ const { DisTube } = require('distube'); const { YtDlpPlugin } = require('@distube/yt-dlp'); const { SoundCloudPlugin } = require('@distube/soundcloud'); const { SpotifyPlugin } = require('@distube/spotify'); +const play = require('play-dl'); const { joinVoiceChannel, createAudioPlayer, @@ -178,11 +179,18 @@ client.on(Events.InteractionCreate, async interaction => { if (!voiceChannel) return interaction.reply({ content: 'Anda harus berada di voice channel!', ephemeral: true }); await interaction.deferReply(); - logToFile(`Fetching stream via DisTube for: ${query}`); + logToFile(`Searching via play-dl for: ${query}`); try { + const searchResults = await play.search(query, { limit: 1 }); + if (!searchResults || searchResults.length === 0) { + return interaction.editReply('Lagu tidak ditemukan!'); + } + const url = searchResults[0].url; + logToFile(`Found URL via play-dl: ${url}`); + await distube.voices.join(voiceChannel, { selfDeaf: false, selfMute: false }); - await distube.play(voiceChannel, query, { + await distube.play(voiceChannel, url, { member: interaction.member, textChannel: interaction.channel, interaction @@ -237,12 +245,23 @@ client.on(Events.MessageCreate, async message => { if (!voiceChannel) return message.reply('Anda harus berada di voice channel!'); if (!query) return message.reply('Masukkan judul atau link lagu!'); - await distube.voices.join(voiceChannel, { selfDeaf: false, selfMute: false }); - await distube.play(voiceChannel, query, { - member: message.member, - textChannel: message.channel, - message - }); + try { + const searchResults = await play.search(query, { limit: 1 }); + if (!searchResults || searchResults.length === 0) { + return message.reply('Lagu tidak ditemukan!'); + } + const url = searchResults[0].url; + + await distube.voices.join(voiceChannel, { selfDeaf: false, selfMute: false }); + await distube.play(voiceChannel, url, { + member: message.member, + textChannel: message.channel, + message + }); + } catch (e) { + logToFile(`Message Play Error: ${e.message}`); + message.reply(`❌ Error: ${e.message}`); + } } else if (['skip', 'stop', 'pause', 'resume'].includes(command)) { if (!voiceChannel) return message.reply('Anda harus berada di voice channel!'); const method = command === 'skip' ? 'skip' : (command === 'stop' ? 'stop' : (command === 'pause' ? 'pause' : 'resume'));