tardis-bot/modules/welcomer/index.js

13 lines
509 B
JavaScript
Raw Normal View History

2021-04-09 11:23:13 +00:00
const AudioQueue=require('../../AudioQueue.js')
2021-04-06 23:36:35 +00:00
module.exports = function (bot, api) {
2021-04-05 14:09:36 +00:00
bot.on('ready', async () => {
console.log("Bot initialized and listening");
2021-04-06 23:36:35 +00:00
const guild = await bot.guilds.fetch(process.env.GUILD);
2021-04-05 14:09:36 +00:00
const channel = await bot.channels.fetch(process.env.CHANNEL);
await api.joinChannel(channel);
2021-04-09 11:23:13 +00:00
let conn=api.getConnectionForVoiceChannel(channel);
api.queue=new AudioQueue(conn);
api.speak(channel, api.strings.WELCOME);
2021-04-06 23:36:35 +00:00
})
2021-04-05 14:09:36 +00:00
}