aiko-chan-ai / Discord-video-selfbot

for djs-selfbot-v13
https://github.com/dank074/Discord-video-stream
34 stars 8 forks source link

bug: can't play video only #17

Closed phorcys420 closed 12 months ago

phorcys420 commented 12 months ago
import { Client, Message } from "discord.js-selfbot-v13";
import { DiscordStreamClient } from "discord-stream-client";

const client = new Client({ checkUpdate: false });
const streamClient = new DiscordStreamClient(client);

client.on("messageCreate", async message => {
    console.log(message.content)
    if(message.content == "doit") {
        const connection = await streamClient.joinVoiceChannel(message.channel, {
            selfDeaf: false,
            selfMute: false,
            selfVideo: false,
        });

        const player = await streamClient.createPlayer("C:\\Users\\<redacted>\\Downloads\\BigBuckBunny.mp3", connection.udp);
        await player.play();
    }
});

client.on("ready", () => console.log("ready"));
client.login(process.argv[2]);

node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: ffmpeg exited with code 1:
    at ChildProcess.<anonymous> (C:\Users\<redacted>\Documents\peter\node_modules\.pnpm\fluent-ffmpeg@2.1.2\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at ChildProcess.emit (node:events:513:28)      
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
Emitted 'error' event on Player instance at:       
    at FfmpegCommand.<anonymous> (C:\Users\<redacted>\Documents\peter\node_modules\.pnpm\discord-stream-client@1.4.2_discord.js-selfbot-v13@2.14.10\node_modules\discord-stream-client\dist\index.js:1414:16)   
    at FfmpegCommand.emit (node:events:513:28)     
    at emitEnd (C:\Users\<redacted>\Documents\peter\node_modules\.pnpm\fluent-ffmpeg@2.1.2\node_modules\fluent-ffmpeg\lib\processor.js:424:16)
    at endCB (C:\Users\<redacted>\Documents\peter\node_modules\.pnpm\fluent-ffmpeg@2.1.2\node_modules\fluent-ffmpeg\lib\processor.js:544:13)
    at handleExit (C:\Users\<redacted>\Documents\peter\node_modules\.pnpm\fluent-ffmpeg@2.1.2\node_modules\fluent-ffmpeg\lib\processor.js:170:11)
    at ChildProcess.<anonymous> (C:\Users\<redacted>\Documents\peter\node_modules\.pnpm\fluent-ffmpeg@2.1.2\node_modules\fluent-ffmpeg\lib\processor.js:182:11)
    at ChildProcess.emit (node:events:513:28)      
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)

Node.js v18.16.0

I'm trying to play a mp3 in a group dm, hence why I can't simply use @discordjs/voice.

The file that I'm using is BigBuckBunny.mp4 converted to mp3 using ffmpeg -i BigBuckBunny.mp4 BigBuckBunny.mp3.

I checked and using BigBuckBunny.mp4 in the JS I gave you works properly. The client is able to play without streaming/sending a video but it can't take videoless files as an input.

aiko-chan-ai commented 12 months ago

If you don't need to play the video, there is an alternative for you https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/VoiceCall.md

phorcys420 commented 12 months ago

If you don't need to play the video, there is an alternative for you https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/VoiceCall.md

oh alright, thanks! I'll try this ASAP.