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(); const audioInstance = await createAudioInstance();
audioInstance.on('data', buffer => { audioInstance.on('audio', (buffer) => {
buffer = Buffer.from(buffer); buffer = Buffer.from(buffer);
const encoded = encoder.encode(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 // 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.quit();
}) })
audioInstance.start();
if (guildID && callback) callback(); if (guildID && callback) callback();
} }

View File

@@ -35,7 +35,7 @@ export async function returnAlsaDeviceObject() {
var i = 0; var i = 0;
for (const responseLine of brokenCommand) { for (const responseLine of brokenCommand) {
if (!String(responseLine).match(/^\s/g)) { if (String(responseLine) && !String(responseLine).match(/^\s/g)) {
const tempDevice = { const tempDevice = {
id: i, id: i,
name: responseLine name: responseLine