Update join command

- Listening to the correct event
- Removed erroneous .start()
This commit is contained in:
Logan Cusano
2023-03-26 02:27:10 -04:00
parent 9a2416e2ff
commit faec0f2291
2 changed files with 2 additions and 4 deletions

View File

@@ -41,7 +41,7 @@ export default async function join({interaction= undefined, guildID= undefined,
const audioInstance = await createAudioInstance();
audioInstance.on('data', buffer => {
audioInstance.on('audio', (buffer) => {
buffer = Buffer.from(buffer);
const encoded = encoder.encode(buffer);
// TODO Add a function here to check the volume of either buffer and only play audio to discord when there is audio to be played
@@ -53,7 +53,5 @@ export default async function join({interaction= undefined, guildID= undefined,
audioInstance.quit();
})
audioInstance.start();
if (guildID && callback) callback();
}