0

I'm trying to use Errbot with HipChat server (not cloud). It looks like Errbot is confused between a room name and its xmpp jid. For example, testing with room named BotTest that has jid of 1_bottest@conf.btf.hipchat.com:

  • When I set CHATROOM_PRESENCE to the room name and send any message in that room, Errbot crashes with the error "Room '1_bottest@conf.btf.hipchat.com' not found".
  • When I set it instead to the room's jid, Errbot creates a new room with the same name as the jid, and a jid of '1_1_bottestconf.btf.hipchat.com@conf.btf.hipchat.com'. Then when I send a message in that new room it crashes with the error "Room '1_1_bottestconf.btf.hipchat.com@conf.btf.hipchat.com' not found".

My config.py is below:

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"
  • @HFBrowning - thanks for the edits! – curmudgeon Aug 31 '17 at 20:06
  • @HFBrowning - I have not added any code of my own. This is just trying to run errbot "out of the box". I added the config.py file I'm using (sans comments) hoping it provides more information.. – curmudgeon Sep 05 '17 at 15:30

2 Answers2

0

You can refer below link ,which will help you http://errbot.io/en/latest/user_guide/configuration/hipchat.html

Akash
  • 587
  • 5
  • 12
  • [Link only answers are not considered good answers for SO](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) – HFBrowning Aug 30 '17 at 18:45
  • @Akash - That link was the basis for my configuration. It does not shed light on the problem I described. – curmudgeon Aug 31 '17 at 20:08
0

While the documentation is very good, I also struggled to get these things just right. Once I did, a re-read of the doc makes sense, but hindsight is 20/20!

Here is an example config section to have your errbot connect to 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',)

IMPORTANT also to note that I had to downgrade these packages to get Hipchat integration working. I made these changes in my requirements.txt:

pyasn1==0.3.7
pyasn1-modules==0.1.5
sleekxmpp==1.3.2
TroyWolf
  • 346
  • 2
  • 5