diff --git a/src/nonebot_plugin_alconna/uniseg/adapters/telegram/exporter.py b/src/nonebot_plugin_alconna/uniseg/adapters/telegram/exporter.py index 06acff3..5dd67a1 100644 --- a/src/nonebot_plugin_alconna/uniseg/adapters/telegram/exporter.py +++ b/src/nonebot_plugin_alconna/uniseg/adapters/telegram/exporter.py @@ -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: @@ -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]):