mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-10-24 11:36:40 +00:00
2.7 KiB
2.7 KiB
sidebar_position, description
| sidebar_position | description |
|---|---|
| 0 | nonebot.plugin 模块 |
nonebot.plugin
本模块为 NoneBot 插件开发提供便携的定义函数。
快捷导入
为方便使用,本模块从子模块导入了部分内容,以下内容可以直接通过本模块导入:
on=>onon_metaevent=>on_metaeventon_message=>on_messageon_notice=>on_noticeon_request=>on_requeston_startswith=>on_startswithon_endswith=>on_endswithon_fullmatch=>on_fullmatchon_keyword=>on_keywordon_command=>on_commandon_shell_command=>on_shell_commandon_regex=>on_regexon_type=>on_typeCommandGroup=>CommandGroupMatchergroup=>MatcherGroupload_plugin=>load_pluginload_plugins=>load_pluginsload_all_plugins=>load_all_pluginsload_from_json=>load_from_jsonload_from_toml=>load_from_tomlload_builtin_plugin=>load_builtin_pluginload_builtin_plugins=>load_builtin_pluginsrequire=>requirePluginMetadata=>PluginMetadata
def get_plugin(name)
-
说明
获取已经导入的某个插件。
如果为
load_plugins文件夹导入的插件,则为文件(夹)名。 -
参数
name(str): 插件名,即 Plugin.name。
-
返回
- Plugin | None
def get_plugin_by_module_name(module_name)
-
说明
通过模块名获取已经导入的某个插件。
如果提供的模块名为某个插件的子模块,同样会返回该插件。
-
参数
module_name(str): 模块名,即 Plugin.module_name。
-
返回
- Plugin | None
def get_loaded_plugins()
-
说明: 获取当前已导入的所有插件。
-
参数
empty
-
返回
- set[Plugin]
def get_available_plugin_names()
-
说明: 获取当前所有可用的插件名(包含尚未加载的插件)。
-
参数
empty
-
返回
- set[str]