Initial module system

This commit is contained in:
2021-04-05 16:09:36 +02:00
parent 9050e4b6ed
commit 62e3adf8a7
4 changed files with 88 additions and 71 deletions

10
modules/welcomer/index.js Normal file
View File

@@ -0,0 +1,10 @@
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);
api.speak(channel, `Hi! I'm alive. It is now ${new Date().toLocaleTimeString()} on ${new Date().toLocaleDateString()}`);
})
}