Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty file when Voice receiver #3816

Closed
lucydjo opened this issue Feb 23, 2020 · 2 comments
Closed

Empty file when Voice receiver #3816

lucydjo opened this issue Feb 23, 2020 · 2 comments

Comments

@lucydjo
Copy link

lucydjo commented Feb 23, 2020

Hi,

The saved file is empty, why ?
Discord.js with @discordjs/opus

client.on('message', async message => {
  if (!message.guild) return;
  let first = true;
  if (message.content === '.join') {
    if (message.member.voice.channel) {

      //DO NOT WORK ! EMPTY FILE =/
      message.member.voice.channel.join().catch(console.error).then(async function(connection) {
          connection.on("disconnect", () => console.log("Disconnecting dispatcher"))
          console.log("Connected")
          const receiver = connection.receiver.createStream('xxxxxxxxxxxxxxxxxxxxxxx');
          var ts = Math.round((new Date()).getTime() / 1000);
          receiver.pipe(fs.createWriteStream( "./rec/"+ts ));
      })


    } else {
      message.reply('You need to join a voice channel first!');
    }
  }
});

Thx !

@monbrey
Copy link
Member

monbrey commented Feb 23, 2020

The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.

@iCrawl
Copy link
Member

iCrawl commented Feb 24, 2020

#3524

@iCrawl iCrawl closed this as completed Feb 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants