import{_ as s,c as a,o as n,ae as t}from"./chunks/framework.BHrE6nLq.js";const d=JSON.parse('{"title":"liteyuki","description":"","frontmatter":{"title":"liteyuki","order":100},"headers":[],"relativePath":"dev/api/plugins/builtin_tools/liteyuki.md","filePath":"zh/dev/api/plugins/builtin_tools/liteyuki.md","lastUpdated":null}'),l={name:"dev/api/plugins/builtin_tools/liteyuki.md"};function e(h,i,k,p,r,o){return n(),a("div",null,i[0]||(i[0]=[t(`<h1 id="模块-nonebot-plugin-marshoai-plugins-builtin-tools-liteyuki" tabindex="-1"><strong>模块</strong> <code>nonebot_plugin_marshoai.plugins.builtin_tools.liteyuki</code> <a class="header-anchor" href="#模块-nonebot-plugin-marshoai-plugins-builtin-tools-liteyuki" aria-label="Permalink to &quot;**模块** \`nonebot_plugin_marshoai.plugins.builtin_tools.liteyuki\`&quot;">​</a></h1><hr><p><code>@on_function_call(description=&#39;获取分布式轻雪机器人节点情况&#39;)</code></p><h3 id="async-func-get-liteyuki-info-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_liteyuki_info() -&gt; str</code> <a class="header-anchor" href="#async-func-get-liteyuki-info-str" aria-label="Permalink to &quot;***async func*** \`get_liteyuki_info() -&gt; str\`&quot;">​</a></h3><p><strong>说明</strong>: 获取分布式轻雪机器人节点情况</p><p><strong>返回</strong>: str: 节点情况</p><details><summary><b>源代码</b> 或 <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/plugins/builtin_tools/liteyuki.py#L7" target="_blank">在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:#6F42C1;--shiki-dark:#B392F0;">@on_function_call</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;获取分布式轻雪机器人节点情况&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_liteyuki_info</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() -&gt; </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    register </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    online </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">    async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> with</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AsyncClient() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> client:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">        response </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> client.get(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;https://api.liteyuki.icu/count&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">        register </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.json().get(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;register&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">        response </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> client.get(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;https://api.liteyuki.icu/online&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">        online </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.json().get(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;online&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">    return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;注册节点数: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">register</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}\\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">在线节点数: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;</span></span></code></pre></div></details>`,7)]))}const E=s(l,[["render",e]]);export{d as __pageData,E as default};
