aboutsummaryrefslogtreecommitdiff
path: root/AudioBackend.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-28 14:25:23 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-28 14:25:23 -0400
commit884e1acf7d3982e66f28dc2cd68e74325f704c6c (patch)
tree8c3e97a7a84b4bf72dc25618376216341fcec6fd /AudioBackend.js
parent5ae481c84ea8edfd9e5589b331f32f453e6e5431 (diff)
downloadDLAP-884e1acf7d3982e66f28dc2cd68e74325f704c6c.tar.gz
DLAP-884e1acf7d3982e66f28dc2cd68e74325f704c6c.tar.bz2
DLAP-884e1acf7d3982e66f28dc2cd68e74325f704c6c.zip
Added more buttons to control command
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) {