errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.13k stars 616 forks source link

Can send message to Hipchat room #786

Closed btoueg closed 8 years ago

btoueg commented 8 years ago

When sending message to Hipchat rooms, I get:

        lounge = self.build_identifier("47131_lounge@conf.hipchat.com")
        self.send(lounge, 'hello')
WARNING  errbot.backends.xmpp      Received error message: <message to="47131_2931392@chat.hipchat.com/none||proxy|pubproxy-c300.hipchat.com|5272" from="Lounge" type="error"><body>hello</body><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></message>

I'm using Python 3.5.1 with:

ansi==0.1.3
apipkg==1.4
beautifulsoup4==4.4.1
bottle==0.12.9
cffi==1.6.0
colorlog==2.7.0
cryptography==1.4
d2to1==0.2.11
daemonize==2.4.6
dnspython3==1.12.0
docutils==0.12
errbot==4.2.1
execnet==1.4.1
hypchat==0.21
idna==2.1
Jinja2==2.8
Markdown==2.6.6
MarkupSafe==0.23
mock==2.0.0
ovh==0.4.2
pbr==1.10.0
pep8==1.7.0
py==1.4.31
pyasn1==0.1.9
pyasn1-modules==0.0.8
pycparser==2.14
Pygments==2.1.3
pygments-markdown-lexer==0.1.0.dev39
pyOpenSSL==16.0.0
pytest==2.9.2
pytest-xdist==1.14
python-dateutil==2.5.3
requests==2.10.0
rocket-errbot==1.2.5
six==1.10.0
sleekxmpp==1.3.1
threadpool==1.3.2
tqdm==4.7.4
waitress==0.9.0
WebOb==1.6.1
WebTest==2.0.21
Yapsy==1.11.223
gbin commented 8 years ago

Can you try with lounge = self.query_room("47131_lounge@conf.hipchat.com") ?

gbin commented 8 years ago

ping

gbin commented 8 years ago

No action here, please reopen if self.query_room doesn't work. Thanks

hanks commented 7 years ago

@gbin hi, I also hit this issue, and I use query_room(), it does not work.

@webhook
def alert(self, request):
    """A webhook which simply returns 'Example'"""
    self.send(
        self.query_room('104136_chatbot-test@conf.hipchat.com'),
        'hello'
    )

and the result is:

23:52:05 INFO     Rocket.Requests           127.0.0.1 - "GET /alert/ HTTP/1.1" - 200 0
23:52:05 WARNING  errbot.backends.xmpp      Received error message: <message type="error" to="104136_3671080@chat.hipchat.com/none||proxy|pubproxy-d400.hipchat.com|5232" from="chatbot-test"><body>hello</body><error type="modify" code="400"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></message>
samof76 commented 7 years ago

I too have the same issue. Unsure what to pass as the room, tried all the options.

self.build_identifier('xxxxx_88822@conf.hipchat.com')

and

self.query_room('.....')
BroHui commented 7 years ago

Have same problem, Errbot version 5.0.1

def callback_message(self, msg): 
        self.send(
                self.build_identifier(u'xxxx@conf.hipchat.com'),
                "Who calling me?"
            )

Then Hipchat return XML contians WARNING errbot.backends.xmpp Received error message: <message from="xxxx@conf.hipchat.com/pylegend" type="error" to="xxxx@chat.hipchat.com/none||proxy|pubproxy-b600.hipchat.com|5262"><body>Who calling me?</body><error code="400" type="modify"><jid-malformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></message>