|
|
@ -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) |
|
|
|
|
|
|
|