Replies: 1 comment 3 replies
-
import nonebot.plugin.on as on |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
mnixry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
因为 nonebot2 在 nonebot.plugin 的第 16 行从 on 模块中导入了重名的 on 函数 :
from .on import on as on,所以现在使用from nonebot.plugin import on导入的是 on 函数,而不是 on 模块现在需要覆盖 on 模块内的部分函数(诸如
on_command、on_keyword之类),但由于上述问题,无法成功覆盖所以想问一下如何操作才能正确覆盖原函数,十分感谢
Beta Was this translation helpful? Give feedback.
All reactions