-
-
Save AllGistsEqual/797e73e110355126399663f65a8367bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check and react to messages | |
bot.onMessage = async function onMessage(message) { | |
/* | |
* THIS IS WHERE OUR OLD CODE REMAINS | |
* => if ping | |
* => if no prefix | |
* => if who | |
* => if whois with/without mention | |
*/ | |
} | |
/* | |
* Register event listeners | |
*/ | |
bot.client.on('ready', bot.onConnect.bind(bot)) | |
bot.client.on('error', err => { | |
bot.log(`Client error: ${err.message}`) | |
}) | |
bot.client.on('reconnecting', () => { | |
bot.log('Reconnecting...') | |
}) | |
bot.client.on('disconnect', evt => { | |
bot.log(`Disconnected: ${evt.reason} (${evt.code})`) | |
}) | |
bot.client.on('message', bot.onMessage.bind(bot)) | |
// start the bot | |
bot.load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment