aboutsummaryrefslogtreecommitdiff
path: root/AudioBackend.js
diff options
context:
space:
mode:
Diffstat (limited to 'AudioBackend.js')
-rw-r--r--AudioBackend.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/AudioBackend.js b/AudioBackend.js
index ec4167d..dbc239a 100644
--- a/AudioBackend.js
+++ b/AudioBackend.js
@@ -24,10 +24,9 @@ import { MessageEmbed } from 'discord.js'
import config from './config.json' assert {type: 'json'}
import fs from 'fs'
-const player = createAudioPlayer();
+export const player = createAudioPlayer();
export let audio;
let fileData;
-let txtFile = true;
export function voiceInit(bot) {
@@ -48,12 +47,12 @@ export function voiceInit(bot) {
player.on('idle', () => {
console.log("Music has finished playing, shuffling music...")
- playAudio();
+ playAudio(bot);
})
playAudio(bot);
connection.subscribe(player);
- })
+ }).catch(e => { console.error("The voice channel does not exist!\\n(Have you looked at your configuration?)") })
}
export function playAudio(bot) {