nonebot-plugin-marshoai/assets/dev_api_tools_marshoai_basic_index.md.Ch_Siirr.js

2 lines
7.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as i,c as a,o as t,ae as n}from"./chunks/framework.AELpvxz7.js";const c=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/tools/marshoai_basic/index.md","filePath":"zh/dev/api/tools/marshoai_basic/index.md","lastUpdated":1734175019000}'),e={name:"dev/api/tools/marshoai_basic/index.md"};function h(l,s,r,p,k,o){return t(),a("div",null,s[0]||(s[0]=[n('<h1 id="模块-nonebot-plugin-marshoai-tools-marshoai-basic" tabindex="-1"><strong>模块</strong> <code>nonebot_plugin_marshoai.tools.marshoai_basic</code> <a class="header-anchor" href="#模块-nonebot-plugin-marshoai-tools-marshoai-basic" aria-label="Permalink to &quot;**模块** `nonebot_plugin_marshoai.tools.marshoai_basic`&quot;"></a></h1><hr><h3 id="async-func-get-weather-location-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_weather(location: str)</code> <a class="header-anchor" href="#async-func-get-weather-location-str" aria-label="Permalink to &quot;***async func*** `get_weather(location: str)`&quot;"></a></h3><details><summary><b>源代码</b> 或 <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/tools/marshoai_basic/__init__.py#L9" 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:#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_weather</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(location: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">):</span></span>\n<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;">location</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">的温度是114514℃。&#39;</span></span></code></pre></div></details><hr><h3 id="async-func-get-current-env" tabindex="-1"><em><strong>async func</strong></em> <code>get_current_env()</code> <a class="header-anchor" href="#async-func-get-current-env" aria-label="Permalink to &quot;***async func*** `get_current_env()`&quot;"></a></h3><details><summary><b>源代码</b> 或 <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/tools/marshoai_basic/__init__.py#L13" 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:#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_current_env</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ver </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> os.popen(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;uname -a&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">).read()</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(ver)</span></span></code></pre></div></details><hr><h3 id="async-func-get-current-time" tabindex="-1"><em><strong>async func</strong></em> <code>get_current_time()</code> <a class="header-anchor" href="#async-func-get-current-time" aria-label="Permalink to &quot;***async func*** `get_current_time()`&quot;"></a></h3><details><summary><b>源代码</b> 或 <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/tools/marshoai_basic/__init__.py#L18" 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:#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_current_time</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt.format(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">date_time</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time.strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;%Y年%m月</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">日 %H:%M:%S&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">weekday_name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">weekdays[current_time.weekday()], </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">lunar_date</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time.to_lunar().date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{干支年}{生肖}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">年</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{月份}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">月</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{日期}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">日&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span></code></pre></div></details>',10)]))}const g=i(e,[["render",h]]);export{c as __pageData,g as default};