generated from Nemesis/Exemple
affichage de données pour les messages privés
This commit is contained in:
parent
1f187a4ad8
commit
b7adf630bc
1 changed files with 23 additions and 0 deletions
23
asmodee.py
23
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue