mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-15 14:24:24 +08:00
12 lines
4.1 KiB
JavaScript
12 lines
4.1 KiB
JavaScript
|
import{_ as e,o as t,c as p,e as a}from"./app-0e_4pVFu.js";const l={},n=a(`<h3 id="def-load-plugin-module-path-str-path-optional-plugin" tabindex="-1"><a class="header-anchor" href="#def-load-plugin-module-path-str-path-optional-plugin"><span><em><strong>def</strong></em> <code>load_plugin(module_path: str | Path) -> Optional[Plugin]</code></span></a></h3><p>加载单个插件,可以是本地插件或是通过 <code>pip</code> 安装的插件。</p><p>参数:</p><pre><code>module_path: 插件名称 \`path.to.your.plugin\`
|
|||
|
|
|||
|
或插件路径 \`pathlib.Path(path/to/your/plugin)\`
|
|||
|
</code></pre><h3 id="def-load-plugins-set-plugin" tabindex="-1"><a class="header-anchor" href="#def-load-plugins-set-plugin"><span><em><strong>def</strong></em> <code>load_plugins() -> set[Plugin]</code></span></a></h3><p>导入文件夹下多个插件</p><p>参数:</p><pre><code>plugin_dir: 文件夹路径
|
|||
|
|
|||
|
ignore_warning: 是否忽略警告,通常是目录不存在或目录为空
|
|||
|
</code></pre><h3 id="def-format-display-name-display-name-str-plugin-type-plugintype-str" tabindex="-1"><a class="header-anchor" href="#def-format-display-name-display-name-str-plugin-type-plugintype-str"><span><em><strong>def</strong></em> <code>format_display_name(display_name: str, plugin_type: PluginType) -> str</code></span></a></h3><p>设置插件名称颜色,根据不同类型插件设置颜色</p><p>Args:</p><pre><code>display_name: 插件名称
|
|||
|
|
|||
|
plugin_type: 插件类型
|
|||
|
</code></pre><p>Returns:</p><pre><code>str: 设置后的插件名称 <y>name</y>
|
|||
|
</code></pre>`,14),i=[n];function o(d,r){return t(),p("div",null,i)}const u=e(l,[["render",o],["__file","load.html.vue"]]),g=JSON.parse('{"path":"/dev/api/plugin/load.html","title":"liteyuki.plugin.load","lang":"zh-CN","frontmatter":{"title":"liteyuki.plugin.load","order":1,"icon":"laptop-code","category":"API","description":"def load_plugin(module_path: str | Path) -> Optional[Plugin] 加载单个插件,可以是本地插件或是通过 pip 安装的插件。 参数: def load_plugins() -> set[Plugin] 导入文件夹下多个插件 参数: def format_display_name(display_n...","head":[["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/plugin/load.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot 轻雪机器人"}],["meta",{"property":"og:title","content":"liteyuki.plugin.load"}],["meta",{"property":"og:description","content":"def load_plugin(module_path: str | Path) -> Optional[Plugin] 加载单个插件,可以是本地插件或是通过 pip 安装的插件。 参数: def load_plugins() -> set[Plugin] 导入文件夹下多个插件 参数: def format_display_name(display_n..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-19T01:55:47.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-19T01:55:47.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.plugin.load\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-19T01:55:47.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":3,"title":"def load_plugin(module_path: str | Path) -> Optional[Plugin]","slug":"def-load-plugin-module-path-str-path-optional-plugin","link":"#def-load-plugin-module-path-str-path-optional-plugin","children":[]},{"level":3,"title":"def load_plugins() -> set[Plugin]","slug":"def-load-plugins-set-plugin","link":"#def-load-plugins-set-plugin","children":[]},{"level":3,"title":"def format_display_name(display_name: str, plugin_type: PluginType) -> str","slug":"def-format-display-name-display-name-str-plugin-type-plugintype-str","link":"#def-format-display-name-display-name-str-plugin-type-plugintype-str","children":[]}],"git":{"createdTime":1724031826000,"updatedTime":1724032547000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":2}]},"readingTime":{"minutes":0.49,"words":147},"filePathRelative":"dev/api/plugin/load.md","localizedDate":"2024年8月19日","autoDesc":true}');export{u as comp,g as data};
|