Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 5a78acc

Browse files
authored
Merge pull request #23 from shuiping233/fix-bug-in-session-controler
fix: 修复了会话控制的文档中错误的`from import`中的`from`,还有删除了示例代码中未定义的`bot_reply`
2 parents ad9fbe7 + a9daa37 commit 5a78acc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

dev/star/plugin.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ AstrBot 提供了开箱即用的会话控制功能:
527527
导入:
528528

529529
```py
530-
from import astrbot.api.message_components as Comp
530+
import astrbot.api.message_components as Comp
531531
from astrbot.core.utils.session_waiter import (
532532
session_waiter,
533533
SessionController,
@@ -552,8 +552,8 @@ async def handle_empty_mention(self, event: AstrMessageEvent):
552552

553553
# ...
554554
message_result = event.make_result()
555-
message_result.chain = [Comp.Plain("先见之明")] # from import astrbot.api.message_components as Comp
556-
await event.send(bot_reply) # 发送回复,不能使用 yield
555+
message_result.chain = [Comp.Plain("先见之明")] # import astrbot.api.message_components as Comp
556+
await event.send(message_result) # 发送回复,不能使用 yield
557557

558558
controller.keep(timeout=60, reset_timeout=True) # 重置超时时间为 60s,如果不重置,则会继续之前的超时时间计时。
559559

@@ -589,7 +589,7 @@ async def handle_empty_mention(self, event: AstrMessageEvent):
589589
默认情况下,AstrBot 会话控制器会将基于 `sender_id` (发送人的 ID)作为识别不同会话的标识,如果想将一整个群作为一个会话,则需要自定义会话 ID 算子。
590590

591591
```py
592-
from import astrbot.api.message_components as Comp
592+
import astrbot.api.message_components as Comp
593593
from astrbot.core.utils.session_waiter import (
594594
session_waiter,
595595
SessionFilter,

0 commit comments

Comments
 (0)