mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-29 01:34:48 +08:00
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
|
import{_ as i,c as e,a7 as a,o as n}from"./chunks/framework.jrU0lkHV.js";const u=JSON.parse('{"title":"liteyuki.session.rule","description":"","frontmatter":{"title":"liteyuki.session.rule"},"headers":[],"relativePath":"en/dev/api/session/rule.md","filePath":"en/dev/api/session/rule.md","lastUpdated":null}'),t={name:"en/dev/api/session/rule.md"};function l(h,s,r,p,k,o){return n(),e("div",null,s[0]||(s[0]=[a('<h1 id="module-liteyuki-session-rule" tabindex="-1"><strong>Module</strong> <code>liteyuki.session.rule</code> <a class="header-anchor" href="#module-liteyuki-session-rule" aria-label="Permalink to "**Module** `liteyuki.session.rule`""></a></h1><p>Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved</p><p>@Time : 2024/8/19 下午10:55 @Author : snowykami @Email : <a href="mailto:snowykami@outlook.com" target="_blank" rel="noreferrer">snowykami@outlook.com</a> @File : rule.py @Software: PyCharm</p><h3 id="var-rulehandlerfunc" tabindex="-1">var <code>RuleHandlerFunc</code> <a class="header-anchor" href="#var-rulehandlerfunc" aria-label="Permalink to "var `RuleHandlerFunc`""></a></h3><ul><li><p><strong>Description</strong>: 规则函数签名</p></li><li><p><strong>Type</strong>: <code>TypeAlias</code></p></li><li><p><strong>Default</strong>: <code>Callable[[MessageEvent], Coroutine[None, None, bool]]</code></p></li></ul><h3 id="class-rule" tabindex="-1"><em><strong>class</strong></em> <code>Rule</code> <a class="header-anchor" href="#class-rule" aria-label="Permalink to "***class*** `Rule`""></a></h3><hr><h4 id="func-init-self-handler-rulehandlerfunc" tabindex="-1"><em><strong>func</strong></em> <code>__init__(self, handler: RuleHandlerFunc)</code> <a class="header-anchor" href="#func-init-self-handler-rulehandlerfunc" aria-label="Permalink to "***func*** `__init__(self, handler: RuleHandlerFunc)`""></a></h4><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/session/rule.py#L24" 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:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, handler: RuleHandlerFunc):</span></span>\n<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> self</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.handler </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> handler</span></span></code></pre></div></details><hr><h4 id="func-self-other-rule-rule" tabindex="-1"><em><strong>func</strong></em> <code>self | other: Rule => Rule</code> <a class="header-anchor" href="#func-self-other-rule-rule" aria-label="Permalink to "***func*** `self | other: Rule => Rule`""></a></h4><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/session/rule.py#L27" 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:#005CC5;--shiki-dark:#79B8FF;"> __or__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, other: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Rule'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Rule'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"
|