DubAPI icon indicating copy to clipboard operation
DubAPI copied to clipboard

user-join and user-leave events

Open kniffen opened this issue 8 years ago • 1 comments

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

kniffen avatar May 24 '17 03:05 kniffen

+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.

Reforced avatar Nov 02 '18 00:11 Reforced