Update join command
- Listening to the correct event - Removed erroneous .start()
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -35,7 +35,7 @@ export async function returnAlsaDeviceObject() {
|
||||
var i = 0;
|
||||
|
||||
for (const responseLine of brokenCommand) {
|
||||
if (!String(responseLine).match(/^\s/g)) {
|
||||
if (String(responseLine) && !String(responseLine).match(/^\s/g)) {
|
||||
const tempDevice = {
|
||||
id: i,
|
||||
name: responseLine
|
||||
|
||||
Reference in New Issue
Block a user