基于 OneBot 标准的 Python 异步 QQ 机器人框架 / Asynchronous QQ robot framework based on OneBot for Python
on_command
定义命令别名有时不生效的 bugnonebot.plugin.unload_plugin
和 reload_plugin
添加 fast
参数用于可选地避免重载时重新导入模块。load_plugin(s)
添加 no_fast
参数nonebot.permission
模块),所有以 int
为类型的权限值和函数参数全部改为了 PermissionPolicy_T
。尽管如此,旧代码中原权限声明常量可在继续使用DEFAULT_COMMAND_PERMISSION
和 DEFAULT_NLP_PERMISSION
用于选定命令处理器和 NLP 的默认权限on_command
,on_natural_language
,on_notice/request
和 message_preprocessor
必须在插件定义的模块中调用以注册相应处理器。直接在 __main__
中调用现在会提示警告并且在后续版本中移除对其的支持message_preprocessor
注册的消息预处理器在 PluginManager.remove_plugin
, PluginManager.switch_plugin_global
, reload_plugin
执行后也会被一并移除nonebot.plugin.PluginManager.switch_messagepreprocessor_global
用于切换消息预处理器开关nonebot.plugin.on_plugin
用于注册插件加载和卸载时的回调nonebot.plugin.unload_plugin
用于卸载插件load_plugin
和 reload_plugin
也支持运行 on_plugin
注册的回调Plugin
类增加 userdata
属性,可在插件中由 __plugin_userdata__
定义本次发布新功能较多,欢迎升级并且汇报使用时遇到的问题。
on_command
中 shell_like
功能仍引用旧 API 造成的错误NLPResult
, CommandSession.args
, CommandSession.get_optional
)BaseSession.send
的 type hintCommandSession.apause
方法在命令过期后泄露的问题on_command
) 现在可以设置不同的运行和过期超时时间