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();
|
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();
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user