Skip to content

Commit

Permalink
Merge pull request #81 from wyf7685/master
Browse files Browse the repository at this point in the history
feat: support telegram forum_topic
  • Loading branch information
RF-Tar-Railt authored Dec 3, 2024
2 parents bc5fbbb + c7179b7 commit 359b039
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 359b039

Please sign in to comment.