diff --git a/community/bot.py b/community/bot.py index 37f6479..9c7a89a 100644 --- a/community/bot.py +++ b/community/bot.py @@ -197,7 +197,7 @@ class CommunityBot(Plugin): # if we haven't exited by now, we must not be banned! return is_banned - async def ban_this_user(self, user, reason="banned"): + async def ban_this_user(self, user, reason="banned", all_rooms=False): #self.log.debug(f"DEBUG getting list of rooms") roomlist = await self.get_space_roomlist() # don't forget to kick from the space itself @@ -214,7 +214,11 @@ class CommunityBot(Plugin): roomname = roomnamestate['name'] # ban user even if they're not in the room! - #await self.client.get_state_event(room, EventType.ROOM_MEMBER, user) + if all_rooms: + pass + else: + await self.client.get_state_event(room, EventType.ROOM_MEMBER, user) + await self.client.ban_user(room, user, reason=reason) if roomname: ban_event_map['ban_list'][user].append(roomname) diff --git a/maubot.yaml b/maubot.yaml index 0e0f460..2554707 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,6 +1,6 @@ maubot: 0.1.0 id: org.jobmachine.communitybot -version: 0.1.15 +version: 0.1.16 license: MIT modules: - community