prevent errors during initialization

This commit is contained in:
Flummi
2018-03-01 08:39:09 +01:00
parent a225922753
commit a4e347bcdc
2 changed files with 71 additions and 78 deletions

View File

@ -13,6 +13,10 @@ const parseArgs = (msg) => {
export default self => {
self.bot.on("message", e => {
for (var [name, trigger] of self._trigger.entries()) {
if (!e.self.me.nickname) {
e.reply("nope, still initialising myself :^)");
break;
}
if (!trigger.call.exec(e.message))
continue;
if (!trigger.clients.includes(e.type))