本文介绍了如何使用python-xmpp设置Jabber状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何通过python设置GChat或jabber状态?现在,我已经知道了:
How do I set a GChat or jabber status via python? Right now I've got this:
import xmpp
new_status = "blah blah blah"
login = 'email'
pwd = 'password'
cnx = xmpp.Client('gmail.com')
cnx.connect( server=('talk.google.com',5223) )
cnx.auth(login, pwd, 'botty')
pres = xmpp.Presence()
pres.setStatus(new_status)
cnx.send(pres)
它执行,但状态为未更新。我知道我已成功连接到服务器,因为我可以向其他人发送聊天消息。我在这里做什么错了?
It executes, but the status is not updated. I know I'm connecting to the server successfully, as I can send chat messages to others. What am I doing wrong here?
推荐答案
您可能想看一下这个文件:
You might want to take a look at this file:
编辑:
我的错误的第一个答案是上下文错误,我误读了您的代码。
My bad, first answer was out of context, I've misread your code.
cnx.sendInitPresence()
我想您还没有发送您的初始状态...
You haven't send your initial state I guess ...
这篇关于如何使用python-xmpp设置Jabber状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!