Skip to content

Instantly share code, notes, and snippets.

@BURG3R5
Last active June 6, 2022 12:44
Show Gist options
  • Save BURG3R5/1c1acef11b352bcff570aba1e61eb721 to your computer and use it in GitHub Desktop.
Save BURG3R5/1c1acef11b352bcff570aba1e61eb721 to your computer and use it in GitHub Desktop.
# IN: events
messages: dict[str, str] = {}
for event in events:
if event["type"] == "m.room.message" and "content" in event and "body" in event["content"]:
messages[event["event_id"]] = event["content"]["body"]
# OUT: messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment