我的项目团队正在使用Cisco Jabber作为即时消息传递工具,我们希望在某些情况下通过脚本自动发送消息。
我想知道是否有任何lib或代码示例可以做到这一点?
非常感谢任何帮助:)
我尝试使用sleekxmpp lib并使用以下页面中的示例代码:
http://sleekxmpp.com/getting_started/sendlogout.html
我在xmpp.connect()中用我自己的Cisco Jabber服务器名称替换,然后运行:
python send_client.py -d -j xxxx@myserver.com -p xxxx -t xxxx@myserver.com -m "This is a message"
但它返回以下错误消息,任何想法?非常感谢。
INFO JID set to: xxxx@xxxx.com/a0d89102ee71f5a1a87c093eff5001d685a02d21
WARNING TLS or SSL was enabled, but no certificate was found.
WARNING Timed out waiting for IqWait_4a447480-22d9-4488-b4b8-d7a3ece5eb5b-3
ERROR Error processing event handler: <bound method EchoBot.start of <__main__.EchoBot object at 0x02D70330>>
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\sleekxmpp\xmlstream\xmlstream.py", line 1699, in _event_runner
func(*args)
File "views.py", line 66, in start
self.get_roster()
File "C:\Python34\lib\site-packages\sleekxmpp\clientxmpp.py", line 258, in get_roster
response = iq.send(block, timeout, callback)
File "C:\Python34\lib\site-packages\sleekxmpp\stanza\iq.py", line 233, in send
raise IqTimeout(self)sleekxmpp.exceptions.IqTimeout: <iq id="4a447480-22d9-4488-b4b8-d7a3ece5eb5b-3" type="get"><query xmlns="jabber:iq:roster" /></iq>
ERROR Request timed out: <iq id="4a447480-22d9-4488-b4b8-d7a3ece5eb5b-3" type="get"><query xmlns="jabber:iq:roster" /></iq>
WARNING You should catch IqTimeout exceptions