voice: remove createReceiver, just use VoiceConnection.receiver

This commit is contained in:
Amish Shah
2018-08-16 18:30:54 +01:00
parent 97c34b5b6f
commit e2726f5a9a
3 changed files with 13 additions and 28 deletions

View File

@@ -41,8 +41,7 @@ client.on('message', m => {
const channel = m.guild.channels.get(m.content.split(' ')[1]) || m.member.voice.channel;
if (channel && channel.type === 'voice') {
channel.join().then(conn => {
const receiver = conn.createReceiver();
receiver.createStream(m.author, true).on('data', b => console.log(b.toString()));
conn.receiver.createStream(m.author, true).on('data', b => console.log(b.toString()));
conn.player.on('error', (...e) => console.log('player', ...e));
if (!connections.has(m.guild.id)) connections.set(m.guild.id, { conn, queue: [] });
m.reply('ok!');