1
0
forked from bot/app
LiteyukiBot/assets/channel.html-CGsdwmN6.js

13 lines
15 KiB
JavaScript
Raw Normal View History

import{_ as e,o as n,c as a,e as c}from"./app-vZ92a7EE.js";const l={},t=c(`<h3 id="def-set-channel-name-str-channel-channel-none" tabindex="-1"><a class="header-anchor" href="#def-set-channel-name-str-channel-channel-none"><span><em><strong>def</strong></em> <code>set_channel(name: str, channel: Channel) -&gt; None</code></span></a></h3><p>设置通道实例</p><p>Args:</p><pre><code>name: 通道名称
channel: 通道实例
</code></pre><h3 id="def-set-channels-channels-dict-str-channel-none" tabindex="-1"><a class="header-anchor" href="#def-set-channels-channels-dict-str-channel-none"><span><em><strong>def</strong></em> <code>set_channels(channels: dict[str, Channel]) -&gt; None</code></span></a></h3><p></p><p>Args:</p><pre><code>channels:
</code></pre><h3 id="def-get-channel-name-str-channel" tabindex="-1"><a class="header-anchor" href="#def-get-channel-name-str-channel"><span><em><strong>def</strong></em> <code>get_channel(name: str) -&gt; Channel</code></span></a></h3><p></p><p>Args:</p><pre><code>name:
</code></pre><p>Returns:</p><h3 id="def-get-channels-dict-str-channel" tabindex="-1"><a class="header-anchor" href="#def-get-channels-dict-str-channel"><span><em><strong>def</strong></em> <code>get_channels() -&gt; dict[str, Channel]</code></span></a></h3><p></p><p>Returns:</p><h3 id="def-on-set-channel-data-tuple-str-dict-str-any-none" tabindex="-1"><a class="header-anchor" href="#def-on-set-channel-data-tuple-str-dict-str-any-none"><span><em><strong>def</strong></em> <code>on_set_channel(data: tuple[str, dict[str, Any]]) -&gt; None</code></span></a></h3><h3 id="def-on-get-channel-data-tuple-str-dict-str-any-none" tabindex="-1"><a class="header-anchor" href="#def-on-get-channel-data-tuple-str-dict-str-any-none"><span><em><strong>def</strong></em> <code>on_get_channel(data: tuple[str, dict[str, Any]]) -&gt; None</code></span></a></h3><h3 id="def-on-get-channels-data-tuple-str-dict-str-any-none" tabindex="-1"><a class="header-anchor" href="#def-on-get-channels-data-tuple-str-dict-str-any-none"><span><em><strong>def</strong></em> <code>on_get_channels(data: tuple[str, dict[str, Any]]) -&gt; None</code></span></a></h3><h3 id="def-decorator-func-callable-t-any-callable-t-any" tabindex="-1"><a class="header-anchor" href="#def-decorator-func-callable-t-any-callable-t-any"><span><em><strong>def</strong></em> <code>decorator(func: Callable[[T], Any]) -&gt; Callable[[T], Any]</code></span></a></h3><h3 id="async-def-wrapper-data-t-any" tabindex="-1"><a class="header-anchor" href="#async-def-wrapper-data-t-any"><span><em><strong>async def</strong></em> <code>wrapper(data: T) -&gt; Any</code></span></a></h3><h3 id="class-channel-generic-t" tabindex="-1"><a class="header-anchor" href="#class-channel-generic-t"><span><em><strong>class</strong></em> <code>Channel(Generic[T])</code></span></a></h3><p></p><p>使 <code>receive</code> 使 <code>on_receive</code> </p><h3 id="def-init-self-id-str-type-check-optional-bool-none" tabindex="-1"><a class="header-anchor" href="#def-init-self-id-str-type-check-optional-bool-none"><span> <em><strong>def</strong></em> <code>__init__(self, _id: str, type_check: Optional[bool]) -&gt; None</code></span></a></h3><p></p><p>Args:</p><pre><code>_id: ID
type_check: 是否开启类型检查, 若为空则传入泛型默认开启否则默认关闭
</code></pre><h3 id="def-send-self-data-t-none" tabindex="-1"><a class="header-anchor" href="#def-send-self-data-t-none"><span> <em><strong>def</strong></em> <code>send(self, data: T) -&gt; None</code></span></a></h3><p></p><p>Args:</p><pre><code>data:
</code></pre><h3 id="def-receive-self-t" tabindex="-1"><a class="header-anchor" href="#def-receive-self-t"><span> <em><strong>def</strong></em> <code>receive(self) -&gt; T</code></span></a></h3><p></p><p>Args:</p><h3 id="def-close-self-none" tabindex="-1"><a class="header-anchor" href="#def-close-self-none"><span> <em><strong>def</strong></em> <code>close(self) -&gt; None</code></span></a></h3><p></p><h3 id="def-on-receive-self-filter-func-optional-filter-func-callable-callable-t-any-callable-t-any" tabindex="-1"><a class="header-anchor" href="#def-on-receive-self-filter-func-optional-filter-func-callable-callable-t-any-callable-t-any"><span> <em><strong>def</strong></em> <code>on_receive(self, filter_func: Optional[FILTER_FUNC]) -&gt; Callable[[Callable[[T], Any]], Callable[[T], Any]]</code></span></a></h3><p></p><p>Args:</p><pre><code>filter_func: None
</code></pre><p>Returns:</p><pre><code>
</code></pre><h3 id="var-t-typevar-t" tabindex="-1"><a class="header-anchor" href="#var-t-typevar-t"><span><em><strong>var</strong></em> <code>T = TypeVar(&#39;T&#39;)</code></span></a></h3><h3 id="var-channel-deliver-active-channel-channel-id-channel-deliver-active-channel" tabindex="-1"><a class="header-anchor" href="#var-channel-deliver-active-channel-channel-id-channel-deliver-active-channel"><span><em><strong>var</strong></em> <code>channel_deliver_active_channel = Channel(_id=&#39;channel_deliver_active_channel&#39;)</code></span></a></h3><h3 id="var-channel-deliver-passive-channel-channel-id-channel-deliver-passive-channel" tabindex="-1"><a class="header-anchor" href="#var-channel-deliver-passive-channel-channel-id-channel-deliver-passive-channel"><span><em><strong>var</strong></em> <code>channel_deliver_passive_channel = Channel(_id=&#39;channel_deliver_passive_channel&#39;)</code></span></a></h3><h3 id="var-recv-chan-data-1-recv-chan" tabindex="-1"><a class="header-anchor" href="#var-recv-chan-data-1-recv-chan"><span><em><strong>var</strong></em> <code>recv_chan = data[1][&#39;recv_chan&#39;]</code></span></a></h3><h3 id="var-recv-chan-channel-channel-any-recv-chan" tabindex="-1"><a class="header-anchor" href="#var-recv-chan-channel-channel-any-recv-chan"><span><em><strong>var</strong></em> <code>recv_chan = Channel[Channel[Any]](&#39;recv_chan&#39;)</code></span></a></h3><h3 id="var-recv-chan-channel-dict-str-channel-any-recv-chan" tabindex="-1"><a class="header-anchor" href="#var-recv-chan-channel-dict-str-channel-any-recv-chan"><span><em><strong>var</strong></em> <code>recv_chan = Channel[dict[str, Channel[Any]]](&#39;recv_chan&#39;)</code></span></a></h3><h3 id="var-type-check-self-get-generic-type-is-not-none" tabindex="-1"><a class="header-anchor" href="#var-type-check-self-get-generic-type-is-not-none"><span><em><strong>var</strong></em> <code>type_check = self._get_generic_type() is not None</code></span></a></h3><h3 id="var-data-self-conn-recv-recv" tabindex="-1"><a class="header-anchor" href="#var-data-self-conn-recv-recv"><span><em><strong>var</strong></em> <code>data = self.conn_recv.recv()</code></span></a></h3><h3 id="var-func-callback-funcs-func-id" tabindex="-1"><a class="header-anchor" href="#var-func-callback-funcs-func-id"><span><em><strong>var</strong></em> <code>func = _callback_funcs[func_id]</code></span></a></h3><h3 id="var-func-callback-funcs-func-id-1" tabindex="-1"><a class="header-anchor" href="#var-func-callback-funcs-func-id-1"><span><em><strong>var</strong></em> <code>func = _callback_funcs[func_id]</code></span></a></h3><h3 id="var-data-self-conn-recv-recv-1" tabindex="-1"><a class="header-anchor" href="#var-data-self-conn-recv-recv-1"><span><em><strong>var</strong></em> <code>data = self.conn_recv.recv()</code></span></a></h3><h3 id="var-data-self-conn-recv-recv-2" tabindex="-1"><a class="header-anchor" href="#var-data-self-conn-recv-recv-2"><span><em><strong>var</strong></em> <code>data = self.conn_recv.recv()</code></span></a></h3>`,55),r=[t];function s(d,h){return n(),a("div",null,r)}const i=e(l,[["render",s],["__file","channel.html.vue"]]),f=JSON.parse(`{"path":"/en/dev/api/comm/channel.html","title":"liteyuki.comm.channel","lang":"en-US","frontmatter":{"title":"liteyuki.comm.channel","order":1,"icon":"laptop-code","category":"API","description":"def set_channel(name: str, channel: Channel) -> None Args: def set_channels(channels: dict[str, Channel]) -> None Args: def get_channel(name: str) -> Channel ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/comm/channel.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/dev/api/comm/channel.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot"}],["meta",{"property":"og:title","content":"liteyuki.comm.channel"}],["meta",{"property":"og:description","content":"def set_channel(name: str, channel: Channel) -> None Args: def set_c