fix(bot): correct event content access in reactions

Changed the `reaction_callback` method to access reaction event contents through `event.source["content"]` instead of `event.content`. This update addresses issues with data access during reaction handling, preventing potential errors. Added debug logging for improved tracing of reaction events.
This commit is contained in:
Kumi 2024-11-08 13:10:36 +01:00
parent 105e5c7abe
commit 7df144e107
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -90,7 +90,9 @@ class ApplicationBot:
await self.open_ticket(room, event.state_key)
async def reaction_callback(self, room: MatrixRoom, event):
relation = event.content.get("m.relates_to", {})
logging.debug(f"Received reaction event: {event}")
relation = event.source["content"].get("m.relates_to", {})
message_id = relation.get("event_id")
key = relation.get("key")