mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Add option to use thread for replies
This commit is contained in:
parent
bf3a3b65d8
commit
f0e2bb3d62
@ -82,6 +82,7 @@ class MaubotMessageEvent(MessageEvent):
|
||||
markdown: bool = True,
|
||||
allow_html: bool = False,
|
||||
reply: bool | str = False,
|
||||
reply_in_thread: bool = False,
|
||||
edits: EventID | MessageEvent | None = None,
|
||||
) -> EventID:
|
||||
if isinstance(content, str):
|
||||
@ -102,6 +103,8 @@ class MaubotMessageEvent(MessageEvent):
|
||||
f"{self.sender}"
|
||||
f"</a>: {fmt_body}"
|
||||
)
|
||||
elif reply_in_thread:
|
||||
content.set_thread_parent(self)
|
||||
else:
|
||||
content.set_reply(self)
|
||||
return await self.client.send_message_event(self.room_id, event_type, content)
|
||||
@ -112,9 +115,15 @@ class MaubotMessageEvent(MessageEvent):
|
||||
event_type: EventType = EventType.ROOM_MESSAGE,
|
||||
markdown: bool = True,
|
||||
allow_html: bool = False,
|
||||
thread: bool = False,
|
||||
) -> Awaitable[EventID]:
|
||||
return self.respond(
|
||||
content, event_type, markdown=markdown, reply=True, allow_html=allow_html
|
||||
content,
|
||||
event_type,
|
||||
markdown=markdown,
|
||||
reply=True,
|
||||
reply_in_thread=thread,
|
||||
allow_html=allow_html,
|
||||
)
|
||||
|
||||
def mark_read(self) -> Awaitable[None]:
|
||||
|
@ -1,4 +1,4 @@
|
||||
mautrix>=0.15.5,<0.19
|
||||
mautrix>=0.16.2,<0.20
|
||||
aiohttp>=3,<4
|
||||
yarl>=1,<2
|
||||
SQLAlchemy>=1,<1.4
|
||||
|
Loading…
Reference in New Issue
Block a user