DubAPI
DubAPI copied to clipboard
user-join and user-leave events
The user-join event only seems to trigger every now and then But the user-leave event doesn't seem to get triggered at all
+1
bot.getUsers() will be filled with all users since the bot joins a room; also the user-join event doesn't get triggered anymore. Made a quick fix myself by replacing case events.userJoin: with
case events.userJoin:
// first remove to fix for broken userLeave
if(this._.room.users.remove(this._.room.users.findWhere({id: msg.user._id}))) {
console.log("Rejoined user");
}
in lib/eventHandler.js. Note that they will still be listed in bot.getUsers(), but the userJoin event gets triggered again at least.
Edit: In an update the userLeave event gets triggered again now and then, depending on how the user closes the site.