Skip to content

Conversation

@chrisdedman
Copy link
Contributor

Description

Refactored message and reaction handling to simplify the API and clean up reaction sending. Updated examples and internal methods to match the new interface.

chrisdedman and others added 30 commits June 19, 2025 22:07
@chrisdedman chrisdedman self-assigned this Dec 18, 2025
Copy link
Contributor

@PenguinBoi12 PenguinBoi12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small thing to change but otherwise good.

:return: The constructed Message instance.
:raise MissingArgumentError: If event is None.
"""
if event is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary since we pass an event.

:return: The constructed Message instance.
"""
if not event and not bot:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't happen since we have bot and event as parameter

"""
try:
msg = Message(self.bot)
msg = self.get_message(self.bot, event)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably get ride of get_message for now and use from_event directly

event_id = event.event_id
body = event.body

return Message(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we should pass the the event now

if event is None:
raise ValueError("event cannot be None")

if isinstance(event, Event) and event.source["type"] == "m.reaction":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense either. It should always be an instance of event.cif they goal is to check the type just check the types you don't have to check the instance

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

Successfully merging this pull request may close these issues.

3 participants