From 15a4fd50f16c739439bcb9a67b0e31b9b9f0ae8d Mon Sep 17 00:00:00 2001 From: nemesis Date: Mon, 10 Nov 2025 11:39:47 +0100 Subject: [PATCH] verifPM --- asmodee.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/asmodee.py b/asmodee.py index 2ec711e..56ad341 100644 --- a/asmodee.py +++ b/asmodee.py @@ -930,7 +930,12 @@ async def verifPMRoom(room, message): # Pour obtenir ou créer un salon pour les bot_nick = getNick(room, message) salon = None room_id = prive.get(sender) - if (room_id): + members = [] + try: + members = await bot.client.get_room_members(room_id) + except: + print("Pas d'accès au salon, on le refait") + if (room_id and members is not None and len(members) > 0): await bot.async_client.room_invite(room_id=room_id, user_id=sender) new_salon = nio.rooms.MatrixRoom(room_id, client_id) new_salon.name=bot_nick