From b7adf630bc5ab19d60a68924198b16bae5516dea Mon Sep 17 00:00:00 2001 From: nemesis Date: Fri, 20 Jul 2018 23:38:54 +0200 Subject: [PATCH] =?UTF-8?q?affichage=20de=20donn=C3=A9es=20pour=20les=20me?= =?UTF-8?q?ssages=20priv=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asmodee.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/asmodee.py b/asmodee.py index f2222ac..f9e510a 100755 --- a/asmodee.py +++ b/asmodee.py @@ -168,6 +168,26 @@ class Parser: #Pour parser la ligne de commande return True return False +def verifPMRoom(room, event): + global bot + nick = getNick(room, event) + client_id = "" + client_host = "" + try: + client_id = bot.client.user_id.split("@")[1].split(":")[0] + except: + client_id = "asmodee_d" + try: + client_host = bot.client.user_id.split("@")[1].split(":")[1] + except: + client_host = "ombreport.info_d" + alias = "#" + client_id + "_" + nick + ":" + client_host + salons = bot.client.rooms + print "client_id = " + client_id + "\nclient_host = " + client_host + "\nnick = " + nick + "\nalias = " + alias + for salon in rooms: + if alias in salon.aliases: + print salon.room_id + def getNick(room, event): members = room.get_joined_members() nick = "" @@ -1015,6 +1035,9 @@ def main(): quote_handler = MCommandHandler("quote", quote) bot.add_handler(quote_handler) + test_handler = MCommandHandler("test", verifPMRoom) + bot.add_handler(test_handler) + # Invitations bot.client.add_invite_listener(invitations)