|
|
|
|
@ -125,6 +125,14 @@ def __help(msg,args): |
|
|
|
|
for cmd in commands_private: |
|
|
|
|
sendMsg(ROOM," !"+cmd+" - "+commands_private[cmd][0],'groupchat') |
|
|
|
|
|
|
|
|
|
def __help2(msg,args): |
|
|
|
|
sendMsg(msg.getFrom(),"Available commands:") |
|
|
|
|
for cmd in commands: |
|
|
|
|
sendMsg(msg.getFrom()," !"+cmd+" - "+commands[cmd][0]) |
|
|
|
|
sendMsg(msg.getFrom(),"Available private chat commands:") |
|
|
|
|
for cmd in commands_private: |
|
|
|
|
sendMsg(msg.getFrom()," !"+cmd+" - "+commands_private[cmd][0]) |
|
|
|
|
|
|
|
|
|
def __messageCB(conn,msg): |
|
|
|
|
if msg.getType() == "groupchat": |
|
|
|
|
body = unicode(msg.getBody()) |
|
|
|
|
@ -241,7 +249,7 @@ def connect_and_join(): |
|
|
|
|
|
|
|
|
|
#add the help command |
|
|
|
|
addCommand("help","Prints this help message",__help) |
|
|
|
|
addPrivateCommand("help","Prints this help message (in private chat)",__help) |
|
|
|
|
addPrivateCommand("help","Prints this help message (in private chat)",__help2) |
|
|
|
|
|
|
|
|
|
#join the room |
|
|
|
|
cl.send(msg) |
|
|
|
|
|