我试图在HipChat服务器(而不是云)中使用Errbot。看起来Errbot混淆了一个房间名和它的xmpp。例如,使用具有jid of BotTest的名为1_bottest@conf.btf.hipchat.com的房间进行测试:
CHATROOM_PRESENCE设置为房间名称并在该房间中发送任何消息时,Errbot与错误"Room '1_bottest@conf.btf.hipchat.com' not found"崩溃。'1_1_bottestconf.btf.hipchat.com@conf.btf.hipchat.com'的jid。然后,当我在那个新房间发送一条消息时,它会因错误"Room '1_1_bottestconf.btf.hipchat.com@conf.btf.hipchat.com' not found".而崩溃。我的config.py如下:
import logging
BACKEND = 'XMPP' # defaults to XMPP
BOT_DATA_DIR = r'/auto/home.nas03/eeshel/work/errbot/data'
BOT_EXTRA_PLUGIN_DIR = '/auto/home.nas03/eeshel/work/errbot/plugins'
BOT_LOG_FILE = r'/auto/home.nas03/eeshel/work/errbot/errbot.log'
BOT_LOG_LEVEL = logging.DEBUG
TEXT_COLOR_THEME = 'dark'
BOT_ADMINS = ('1_8@chat.btf.hipchat.com', )
BOT_PREFIX = '\\'
BOT_ALT_PREFIXES = ('Hermes',)
BOT_ALT_PREFIX_SEPARATORS = (':', ',', ';')
BOT_ALT_PREFIX_CASEINSENSITIVE = True
CHATROOM_FN = 'Hermes the Bot'
CHATROOM_PRESENCE = ('1_bottest@conf.btf.hipchat.com',)
BOT_IDENTITY = {
'username' : '1_2@hipchat.eng.<ourdomain>',
'password' : '*****',
'token' : '*****',
'endpoint' : '10.18.0.185',
}
XMPP_KEEPALIVE_INTERVAL = 60
XMPP_USE_IPV6 = False
XMPP_CA_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt"发布于 2017-08-30 18:28:33
您可以参考下面的链接,这将帮助您指南/配置/hichat.html
发布于 2018-11-14 16:04:09
虽然文档非常好,但我也很难把这些东西做好。一旦我这样做了,重读一遍医生是有意义的,但事后却是20/20!
下面是一个配置示例部分,让您的errbot连接到Hipchat:
# Assuming you are @jdoe in your Hipchat and you want admin privs for your bot
BOT_ADMINS = ('@jdoe', '@mmouse', )
# Let's assume your bot's Hipchat account is "superbot" with
# full name of "Super Bot"
BACKEND = 'Hipchat'
if BACKEND == 'Hipchat':
# http://errbot.io/en/latest/user_guide/configuration/hipchat.html
BOT_IDENTITY = {
# You get username by logging into Hipchat with the account, then go to
# Profile / XMPP/Jabber Info and find the "Jabber ID"
'username': '123456_1234567@chat.hipchat.com',
# Simply the password of the Hipchat account
'password': 'password12345',
# You get token by logging into Hipchat with the account, then go to
# Profile / API Access and generate an API token--assigning it all
# scopes unless you know otherwise.
'token': 'azwx2BdVzGz0riEjqybWinLbUkBSIz6rpsa259HE',
## If you're using HipChat server (self-hosted HipChat) then you should set
## the endpoint below. If you don't use HipChat server but use the hosted version
## of HipChat then you may leave this commented out.
#'endpoint': 'https://api.hipchat.com'
}
CHATROOM_FN = 'Super Bot'
BOT_ALT_PREFIXES = ('@superbot', '@SuperBot', '@stinkfinger',)
# To "listen" for any mentions of @superbot:
CHATROOM_PRESENCE = ()
# To also join rooms to listen to all messages in those rooms,
# do this instead:
#CHATROOM_PRESENCE = ('Room 1', 'Lounge',)还需要注意的是,为了让Hipchat集成工作,我不得不降低这些包的级别。我在我的requirements.txt中做了以下修改:
pyasn1==0.3.7
pyasn1-modules==0.1.5
sleekxmpp==1.3.2https://stackoverflow.com/questions/45967271
复制相似问题