Add audio queue
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const AudioQueue=require('../../AudioQueue.js')
|
||||
|
||||
module.exports = function (bot, api) {
|
||||
bot.on('voiceStateUpdate', async (oldState, newState) => {
|
||||
if (newState.member.user.bot) return;
|
||||
@@ -11,6 +13,8 @@ module.exports = function (bot, api) {
|
||||
let joined = false;
|
||||
if (!oldState.channel) {
|
||||
joined = true;
|
||||
let conn=api.getConnectionForVoiceChannel(channel);
|
||||
api.queue=new AudioQueue(conn);
|
||||
}
|
||||
|
||||
let username = newState.member.displayName;
|
||||
|
@@ -1,10 +1,13 @@
|
||||
const AudioQueue=require('../../AudioQueue.js')
|
||||
|
||||
module.exports = function (bot, api) {
|
||||
bot.on('ready', async () => {
|
||||
console.log("Bot initialized and listening");
|
||||
const guild = await bot.guilds.fetch(process.env.GUILD);
|
||||
const channel = await bot.channels.fetch(process.env.CHANNEL);
|
||||
await api.joinChannel(channel);
|
||||
|
||||
let conn=api.getConnectionForVoiceChannel(channel);
|
||||
api.queue=new AudioQueue(conn);
|
||||
api.speak(channel, `Hey buddies! How does it feel like to be a buddy? Are you proud of being a buddy? Well that's great!'`);
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user