Skip to content

Commit

Permalink
✨ support telegram forum_topic
Browse files Browse the repository at this point in the history
  • Loading branch information
wyf7685 committed Dec 3, 2024
1 parent bc5fbbb commit c7179b7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_target(self, event: Event, bot: Union[Bot, None] = None) -> Target:
adapter=self.get_adapter(),
self_id=bot.self_id if bot else None,
scope=SupportScope.telegram,
extra={"message_thread_id": getattr(event, "message_thread_id", None)},
)

def get_message_id(self, event: Event) -> str:
Expand Down Expand Up @@ -179,6 +180,7 @@ async def send_to(self, target: Union[Target, Event], bot: Bot, message: Message
if isinstance(target, Event):
assert isinstance(target, TgEvent)
return await bot.send(event=target, message=message, reply_markup=reply_markup, **kwargs)
kwargs.setdefault("message_thread_id", target.extra.get("message_thread_id", None))
return await bot.send_to(target.id, message=message, reply_markup=reply_markup, **kwargs)

async def recall(self, mid: Any, bot: Bot, context: Union[Target, Event]):
Expand Down

0 comments on commit c7179b7

Please sign in to comment.