mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-11 06:27:23 +08:00
2 lines
3.5 KiB
JavaScript
2 lines
3.5 KiB
JavaScript
import{_ as i,c as s,o as a,a9 as e}from"./chunks/framework.C4_mTacX.js";const _=JSON.parse('{"title":"liteyuki.plugins.plugin_loader","description":"","frontmatter":{"title":"liteyuki.plugins.plugin_loader","collapsed":true},"headers":[],"relativePath":"en/dev/api/plugins/plugin_loader/index.md","filePath":"en/dev/api/plugins/plugin_loader/index.md","lastUpdated":null}'),l={name:"en/dev/api/plugins/plugin_loader/index.md"},n=e('<h1 id="module-liteyuki-plugins-plugin-loader" tabindex="-1"><strong>Module</strong> <code>liteyuki.plugins.plugin_loader</code> <a class="header-anchor" href="#module-liteyuki-plugins-plugin-loader" aria-label="Permalink to "**Module** `liteyuki.plugins.plugin_loader`""></a></h1><p>Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved</p><p>@Time : 2024/8/11 下午10:02 @Author : snowykami @Email : <a href="mailto:snowykami@outlook.com" target="_blank" rel="noreferrer">snowykami@outlook.com</a> @File : <strong>init</strong>.py.py @Software: PyCharm</p><hr><h3 id="func-default-plugins-loader" tabindex="-1"><em><strong>func</strong></em> <code>default_plugins_loader()</code> <a class="header-anchor" href="#func-default-plugins-loader" aria-label="Permalink to "***func*** `default_plugins_loader()`""></a></h3><p><strong>Description</strong>: 默认插件加载器,应在初始化时调用</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/plugins/plugin_loader/__init__.py#L21" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> default_plugins_loader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> plugin </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> get_config(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'liteyuki.plugins'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, []):</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> load_plugin(plugin)</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> plugin_dir </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> get_config(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'liteyuki.plugin_dirs'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'src/liteyuki_plugins'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]):</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> load_plugins(plugin_dir)</span></span></code></pre></div></details>',7),t=[n];function p(o,r,d,h,u,k){return a(),s("div",null,t)}const c=i(l,[["render",p]]);export{_ as __pageData,c as default};
|