forked from bot/app
21 lines
11 KiB
JavaScript
21 lines
11 KiB
JavaScript
import{_ as e,o as n,c as t,e as o}from"./app-0e_4pVFu.js";const s={},a=o(`<h3 id="def-get-bot-liteyukibot" tabindex="-1"><a class="header-anchor" href="#def-get-bot-liteyukibot"><span><em><strong>def</strong></em> <code>get_bot() -> LiteyukiBot</code></span></a></h3><p>获取轻雪实例</p><p>Returns:</p><pre><code>LiteyukiBot: 当前的轻雪实例
|
||
</code></pre><h3 id="def-get-config-key-str-default-any-any" tabindex="-1"><a class="header-anchor" href="#def-get-config-key-str-default-any-any"><span><em><strong>def</strong></em> <code>get_config(key: str, default: Any) -> Any</code></span></a></h3><p>获取配置</p><p>Args:</p><pre><code>key: 配置键
|
||
|
||
default: 默认值
|
||
</code></pre><p>Returns:</p><pre><code>Any: 配置值
|
||
</code></pre><h3 id="def-get-config-with-compat-key-str-compat-keys-tuple-str-default-any-any" tabindex="-1"><a class="header-anchor" href="#def-get-config-with-compat-key-str-compat-keys-tuple-str-default-any-any"><span><em><strong>def</strong></em> <code>get_config_with_compat(key: str, compat_keys: tuple[str], default: Any) -> Any</code></span></a></h3><p>获取配置,兼容旧版本</p><p>Args:</p><pre><code>key: 配置键
|
||
|
||
compat_keys: 兼容键
|
||
|
||
default: 默认值
|
||
</code></pre><p>Returns:</p><pre><code>Any: 配置值
|
||
</code></pre><h3 id="def-print-logo-none" tabindex="-1"><a class="header-anchor" href="#def-print-logo-none"><span><em><strong>def</strong></em> <code>print_logo() -> None</code></span></a></h3><h3 id="class-liteyukibot" tabindex="-1"><a class="header-anchor" href="#class-liteyukibot"><span><em><strong>class</strong></em> <code>LiteyukiBot</code></span></a></h3><h3 id="def-run-self-any-none" tabindex="-1"><a class="header-anchor" href="#def-run-self-any-none"><span> <em><strong>def</strong></em> <code>run(self: Any) -> None</code></span></a></h3><p> 启动逻辑</p><h3 id="def-keep-alive-self-any-none" tabindex="-1"><a class="header-anchor" href="#def-keep-alive-self-any-none"><span> <em><strong>def</strong></em> <code>keep_alive(self: Any) -> None</code></span></a></h3><p> 保持轻雪运行</p><p>Returns:</p><h3 id="def-restart-self-any-delay-int-none" tabindex="-1"><a class="header-anchor" href="#def-restart-self-any-delay-int-none"><span> <em><strong>def</strong></em> <code>restart(self: Any, delay: int) -> None</code></span></a></h3><p> 重启轻雪本体</p><p>Returns:</p><h3 id="def-restart-process-self-any-name-optional-str-none" tabindex="-1"><a class="header-anchor" href="#def-restart-process-self-any-name-optional-str-none"><span> <em><strong>def</strong></em> <code>restart_process(self: Any, name: Optional[str]) -> None</code></span></a></h3><p> 停止轻雪</p><p>Args:</p><pre><code>name: 进程名称, 默认为None, 所有进程
|
||
</code></pre><p>Returns:</p><h3 id="def-init-self-any-none" tabindex="-1"><a class="header-anchor" href="#def-init-self-any-none"><span> <em><strong>def</strong></em> <code>init(self: Any) -> None</code></span></a></h3><p> 初始化轻雪, 自动调用</p><p>Returns:</p><h3 id="def-init-logger-self-any-none" tabindex="-1"><a class="header-anchor" href="#def-init-logger-self-any-none"><span> <em><strong>def</strong></em> <code>init_logger(self: Any) -> None</code></span></a></h3><p> </p><h3 id="def-stop-self-any-none" tabindex="-1"><a class="header-anchor" href="#def-stop-self-any-none"><span> <em><strong>def</strong></em> <code>stop(self: Any) -> None</code></span></a></h3><p> 停止轻雪</p><p>Returns:</p><h3 id="def-on-before-start-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-before-start-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_before_start(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册启动前的函数</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p><h3 id="def-on-after-start-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-after-start-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_after_start(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册启动后的函数</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p><h3 id="def-on-after-shutdown-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-after-shutdown-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册停止后的函数:未实现</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p><h3 id="def-on-before-process-shutdown-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-before-process-shutdown-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册进程停止前的函数,为子进程停止时调用</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p><h3 id="def-on-before-process-restart-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-before-process-restart-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册进程重启前的函数,为子进程重启时调用</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p><h3 id="def-on-after-restart-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-after-restart-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_after_restart(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册重启后的函数:未实现</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p><h3 id="def-on-after-nonebot-init-self-any-func-lifespan-func-none" tabindex="-1"><a class="header-anchor" href="#def-on-after-nonebot-init-self-any-func-lifespan-func-none"><span> <em><strong>def</strong></em> <code>on_after_nonebot_init(self: Any, func: LIFESPAN_FUNC) -> None</code></span></a></h3><p> 注册nonebot初始化后的函数</p><p>Args:</p><pre><code>func:
|
||
</code></pre><p>Returns:</p>`,74),f=[a];function r(l,d){return n(),t("div",null,f)}const i=e(s,[["render",r],["__file","index.html.vue"]]),p=JSON.parse('{"path":"/dev/api/bot/","title":"liteyuki.bot","lang":"zh-CN","frontmatter":{"title":"liteyuki.bot","index":true,"icon":"laptop-code","category":"API","description":"def get_bot() -> LiteyukiBot 获取轻雪实例 Returns: def get_config(key: str, default: Any) -> Any 获取配置 Args: Returns: def get_config_with_compat(key: str, compat_keys: tuple[str], defa...","head":[["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/bot/"}],["meta",{"property":"og:site_name","content":"LiteyukiBot 轻雪机器人"}],["meta",{"property":"og:title","content":"liteyuki.bot"}],["meta",{"property":"og:description","content":"def get_bot() -> LiteyukiBot 获取轻雪实例 Returns: def get_config(key: str, default: Any) -> Any 获取配置 Args: Returns: def get_config_with_compat(key: str, compat_keys: tuple[str], defa..."}],["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.bot\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-19T01:55:47.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":3,"title":"def get_bot() -> LiteyukiBot","slug":"def-get-bot-liteyukibot","link":"#def-get-bot-liteyukibot","children":[]},{"level":3,"title":"def get_config(key: str, default: Any) -> Any","slug":"def-get-config-key-str-default-any-any","link":"#def-get-config-key-str-default-any-any","children":[]},{"level":3,"title":"def get_config_with_compat(key: str, compat_keys: tuple[str], default: Any) -> Any","slug":"def-get-config-with-compat-key-str-compat-keys-tuple-str-default-any-any","link":"#def-get-config-with-compat-key-str-compat-keys-tuple-str-default-any-any","children":[]},{"level":3,"title":"def print_logo() -> None","slug":"def-print-logo-none","link":"#def-print-logo-none","children":[]},{"level":3,"title":"class LiteyukiBot","slug":"class-liteyukibot","link":"#class-liteyukibot","children":[]},{"level":3,"title":"def run(self: Any) -> None","slug":"def-run-self-any-none","link":"#def-run-self-any-none","children":[]},{"level":3,"title":"def keep_alive(self: Any) -> None","slug":"def-keep-alive-self-any-none","link":"#def-keep-alive-self-any-none","children":[]},{"level":3,"title":"def restart(self: Any, delay: int) -> None","slug":"def-restart-self-any-delay-int-none","link":"#def-restart-self-any-delay-int-none","children":[]},{"level":3,"title":"def restart_process(self: Any, name: Optional[str]) -> None","slug":"def-restart-process-self-any-name-optional-str-none","link":"#def-restart-process-self-any-name-optional-str-none","children":[]},{"level":3,"title":"def init(self: Any) -> None","slug":"def-init-self-any-none","link":"#def-init-self-any-none","children":[]},{"level":3,"title":"def init_logger(self: Any) -> None","slug":"def-init-logger-self-any-none","link":"#def-init-logger-self-any-none","children":[]},{"level":3,"title":"def stop(self: Any) -> None","slug":"def-stop-self-any-none","link":"#def-stop-self-any-none","children":[]},{"level":3,"title":"def on_before_start(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-before-start-self-any-func-lifespan-func-none","link":"#def-on-before-start-self-any-func-lifespan-func-none","children":[]},{"level":3,"title":"def on_after_start(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-after-start-self-any-func-lifespan-func-none","link":"#def-on-after-start-self-any-func-lifespan-func-none","children":[]},{"level":3,"title":"def on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-after-shutdown-self-any-func-lifespan-func-none","link":"#def-on-after-shutdown-self-any-func-lifespan-func-none","children":[]},{"level":3,"title":"def on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-before-process-shutdown-self-any-func-lifespan-func-none","link":"#def-on-before-process-shutdown-self-any-func-lifespan-func-none","children":[]},{"level":3,"title":"def on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-before-process-restart-self-any-func-lifespan-func-none","link":"#def-on-before-process-restart-self-any-func-lifespan-func-none","children":[]},{"level":3,"title":"def on_after_restart(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-after-restart-self-any-func-lifespan-func-none","link":"#def-on-after-restart-self-any-func-lifespan-func-none","children":[]},{"level":3,"title":"def on_after_nonebot_init(self: Any, func: LIFESPAN_FUNC) -> None","slug":"def-on-after-nonebot-init-self-any-func-lifespan-func-none","link":"#def-on-after-nonebot-init-self-any-func-lifespan-func-none","children":[]}],"git":{"createdTime":1724031826000,"updatedTime":1724032547000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":2}]},"readingTime":{"minutes":1.23,"words":370},"filePathRelative":"dev/api/bot/README.md","localizedDate":"2024年8月19日","autoDesc":true}');export{i as comp,p as data};
|