我正在使用以下机器人(基于xmppy):
import xmpp, os
user = 'uname'
password = 'pass'
server="talk.google.com"
def message_handler(connect_object, message_node):
messageFromCounterPart = message_node.getBody()
connect_object.send( xmpp.Message( message_node.getFrom() ,message_node.getBody()))
jid = xmpp.JID(user)
connection = xmpp.Client(jid.getDomain())
connection.connect(server = (server, 5223))
result = connection.auth(jid.getNode(), password, "LFY-client")
connection.RegisterHandler('message', message_handler)
connection.sendInitPresence()
while connection.Process(1):
pass
如何使它接收和发送文件?在这种情况下,节是否有特殊名称?(如connection.RegisterHandler('message', message_handler)
)谢谢。