Only adding users to known rooms.
This commit is contained in:
+2
-3
@@ -116,9 +116,8 @@ function onRooms({ rooms, users }, bot) {
|
||||
|
||||
/* eslint-disable no-param-reassign */
|
||||
function onJoin(data, bot) {
|
||||
bot.users[data.user.id] = data.user;
|
||||
|
||||
if (!bot.rooms[data.roomId].includes(data.user.id)) {
|
||||
if (bot.rooms[data.roomId] && !bot.rooms[data.roomId]?.includes(data.user.id)) {
|
||||
bot.users[data.user.id] = data.user;
|
||||
bot.rooms[data.roomId].push(data.user.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user