cardoso / errbot-rocketchat

Errbot for Rocket.Chat - fork of unmaintained https://github.com/AoiKuiyuyou/AoikRocketChatErrbot
MIT License
11 stars 8 forks source link

ValueError: Argument `in_reply_to` must be given. #10

Open HackyPenguin opened 6 years ago

HackyPenguin commented 6 years ago

Hi guys,

I am trying to get the rocketchat backend to work with a jira bot https://github.com/rawouter/err-jira

However when a message is passed I get a value error

  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 454, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/errbot-rocketchat/src/aoikrocketchaterrbot/plugins/err-jira/errjira.py", line 185, in jira_get
    in_reply_to=msg
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/botplugin.py", line 563, in send_card
    self._bot.send_card(Card(body, frm, to, in_reply_to, summary, title, link, image, thumbnail, color, fields))
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 186, in send_card
    self.send_templated(card.to, 'card', {'card': card})
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 156, in send_templated
    return self.send(identifier, text, in_reply_to, groupchat_nick_reply)
  File "/errbot-rocketchat/src/aoikrocketchaterrbot/backends/aoikrocketchaterrbot.py", line 1293, in send
    raise ValueError(error_msg)
ValueError: Argument `in_reply_to` must be given.
"
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 454, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/errbot-rocketchat/src/aoikrocketchaterrbot/plugins/err-jira/errjira.py", line 185, in jira_get
    in_reply_to=msg
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/botplugin.py", line 563, in send_card
    self._bot.send_card(Card(body, frm, to, in_reply_to, summary, title, link, image, thumbnail, color, fields))
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 186, in send_card
    self.send_templated(card.to, 'card', {'card': card})
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 156, in send_templated
    return self.send(identifier, text, in_reply_to, groupchat_nick_reply)
  File "/errbot-rocketchat/src/aoikrocketchaterrbot/backends/aoikrocketchaterrbot.py", line 1293, in send
    raise ValueError(error_msg)

I am really new to errbot and dont mind contributing to the fix looks like this exception is raised on line of 1287 of the plugin however it is manually set to None in the send function on line 1254. im not really sure whats going on to be honest. Any pointers here would be appreciated

torgeirl commented 6 years ago

Looks like you're using Errbot's send_card() function. That functionality isn't implemented. I have meant to look into it myself, but haven't had time to look at it yet.

Without it, sending media with this bot won't work. :disappointed:

HackyPenguin commented 6 years ago

:( any idea when you will get a chance? if you can point me to resources on how you would go about implementing it ill give it a shot.

torgeirl commented 6 years ago

@HackyPenguin: I would start with how it's done for the Slack backend. I might be able to take a quick look later this week, not sure.

HackyPenguin commented 6 years ago

@torgeirl I have had a quick look and looks abit beyond me at the moment with lack of errbot knowledge. if you could take a look when you get a chance would be massively appreciated :D

HackyPenguin commented 5 years ago

hey @torgeirl you had a chance to look at this? issue seems to occur even if im not using send.card and just using send?

This simple botcmd

@botcmd
def jira(self, msg args):
    "say hello and confirm jira plugin is loaded"
    send(in_reply_to=Message.frm, text="this is a test reponse")

returns the same value error


Exception in thread WebSocketClient:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/site-packages/ws4py-0.5.1-py3.6.egg/ws4py/websocket.py", line 528, in run
    if not self.once():
  File "/usr/local/lib/python3.6/site-packages/python_ddp-0.1.5-py3.6.egg/DDPClient.py", line 53, in once
    return super(DDPSocket, self).once()
  File "/usr/local/lib/python3.6/site-packages/ws4py-0.5.1-py3.6.egg/ws4py/websocket.py", line 410, in once
    if not self.process(self.buf[:requested]):
  File "/usr/local/lib/python3.6/site-packages/ws4py-0.5.1-py3.6.egg/ws4py/websocket.py", line 480, in process
    self.received_message(s.message)
  File "/usr/local/lib/python3.6/site-packages/python_ddp-0.1.5-py3.6.egg/DDPClient.py", line 41, in received_message
    self.emit('received_message', data)
  File "/usr/local/lib/python3.6/site-packages/pyee-5.0.0-py3.6.egg/pyee/__init__.py", line 151, in emit
    result = f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/python_ddp-0.1.5-py3.6.egg/DDPClient.py", line 216, in received_message
    callback(data.get('error'), sub_id)
  File "/usr/local/lib/python3.6/site-packages/python_meteor-0.1.6-py3.6.egg/MeteorClient.py", line 210, in subscribed
    callback(None)
  File "/errbot-rocketchat/src/aoikrocketchaterrbot/backends/aoikrocketchaterrbot.py", line 990, in _meteor_subscribe_callback
    self.connect_callback()
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 638, in connect_callback
    self.warn_admins(errors)
  File "/usr/local/lib/python3.6/site-packages/errbot-6.0.0a0-py3.6.egg/errbot/core.py", line 571, in warn_admins
    self.send(self.build_identifier(admin), warning)
    raise ValueError(error_msg)
ValueError: Argument `in_reply_to` must be given.

  File "/errbot-rocketchat/src/aoikrocketchaterrbot/```