Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't handle requests made by replying, in encrypted rooms #12

Open
kylrth opened this issue Jun 29, 2023 · 0 comments
Open

can't handle requests made by replying, in encrypted rooms #12

kylrth opened this issue Jun 29, 2023 · 0 comments

Comments

@kylrth
Copy link

kylrth commented Jun 29, 2023

In an encrypted room, the bot can edit just fine if asked to edit the message immediately preceding, but it cannot edit if the message is selected by replying:

encrypted room with sedbot

It appears that self.client.get_event returns an EncryptedEvent, which the plugin can't handle:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mautrix/client/syncer.py", line 235, in _catch_errors
    await handler(data)
  File "/data/plugins/xyz.maubot.sed-v1.1.0.mbp/sed.py", line 192, in message_handler
    await self.command_handler(evt)
  File "/opt/maubot/maubot/handlers/command.py", line 490, in replacement
    await asyncio.gather(combine(self, evt), orig_replacement(self, evt))
  File "/opt/maubot/maubot/handlers/command.py", line 480, in replacement
    await func(self, evt, val)
  File "/data/plugins/xyz.maubot.sed-v1.1.0.mbp/sed.py", line 205, in command_handler
    await self._command_handler(evt, match)
  File "/data/plugins/xyz.maubot.sed-v1.1.0.mbp/sed.py", line 223, in _command_handler
    await self._try_replace_event(evt.event_id, stmt, reply_evt)
  File "/data/plugins/xyz.maubot.sed-v1.1.0.mbp/sed.py", line 166, in _try_replace_event
    replaced = self._exec(stmt, orig_evt.content.body)
AttributeError: 'EncryptedMegolmEventContent' object has no attribute 'body'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant