首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在HipChat中配置errbot存在

在HipChat中配置errbot存在
EN

Stack Overflow用户
提问于 2017-08-30 18:19:04
回答 2查看 291关注 0票数 0

我试图在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"崩溃。
  • 当我将其设置为房间的jid时,Errbot将创建一个与jid同名的新房间,并创建一个'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如下:

代码语言:javascript
复制
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"
EN

回答 2

Stack Overflow用户

发布于 2017-08-30 18:28:33

您可以参考下面的链接,这将帮助您指南/配置/hichat.html

票数 0
EN

Stack Overflow用户

发布于 2018-11-14 16:04:09

虽然文档非常好,但我也很难把这些东西做好。一旦我这样做了,重读一遍医生是有意义的,但事后却是20/20!

下面是一个配置示例部分,让您的errbot连接到Hipchat:

代码语言:javascript
复制
# 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中做了以下修改:

代码语言:javascript
复制
pyasn1==0.3.7
pyasn1-modules==0.1.5
sleekxmpp==1.3.2
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45967271

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档