Skip to content

Commit 301df11

Browse files
fix: prevent KeyError in Telegram collect_commands when plugin handler not in star_map (#7405)
* fix: prevent KeyError in collect_commands when plugin handler not in star_map * chore: ruff format --------- Co-authored-by: Soulter <905617992@qq.com>
1 parent 2fae221 commit 301df11

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

astrbot/core/platform/sources/telegram/tg_adapter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ def collect_commands(self) -> list[BotCommand]:
228228

229229
for handler_md in star_handlers_registry:
230230
handler_metadata = handler_md
231-
if not star_map[handler_metadata.handler_module_path].activated:
231+
if (
232+
handler_metadata.handler_module_path not in star_map
233+
or not star_map[handler_metadata.handler_module_path].activated
234+
):
232235
continue
233236
if not handler_metadata.enabled:
234237
continue

0 commit comments

Comments
 (0)