Skip to content

Question: 如何在 run_preprocessor 中对 matcher 的 permission_updater 进行修改? #140

Answered by yanyongyu
Ailitonia asked this question in 问答
Discussion options

You must be logged in to vote

matcher 实例化后修改permission updater会直接修改Matcher类的updater,影响到所有实例。

至于报错原因,看上去是因为ForwardRef的原因,你的代码中是否有 from __future__ import annotations这种语句,导致没有识别到具体的类,但是nb对这种情况会有Warning处理,也不应该报错才对。

补充:问题应该在这段代码的bot参数标注类型没能正确识别

async def __call__(self, bot: Bot) -> bool:

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Ailitonia
Comment options

@yanyongyu
Comment options

@Ailitonia
Comment options

Answer selected by yanyongyu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
问答
Labels
None yet
2 participants