import{_ass,casi,oase,a4asa}from"./chunks/framework.BZiUP1E-.js";consty=JSON.parse('{"title":"liteyuki.message.rule","description":"","frontmatter":{"title":"liteyuki.message.rule"},"headers":[],"relativePath":"dev/api/message/rule.md","filePath":"zh/dev/api/message/rule.md","lastUpdated":null}'),t={name:"dev/api/message/rule.md"},n=a('<h1id="liteyuki-message-rule"tabindex="-1">liteyuki.message.rule<aclass="header-anchor"href="#liteyuki-message-rule"aria-label="Permalink to "liteyuki.message.rule""></a></h1><p><strong>说明</strong>:Copyright(C)2020-2024LiteyukiStudio.AllRightsReserved</p><p>@Time:2024/8/19下午10:55@Author:snowykami@Email:<ahref="mailto:snowykami@outlook.com"target="_blank"rel="noreferrer">snowykami@outlook.com</a>@File:rule.py@Software:PyCharm</p><h3id="var-rulehandlerfunc"tabindex="-1">var<code>RuleHandlerFunc</code><aclass="header-anchor"href="#var-rulehandlerfunc"aria-label="Permalinkto"var`RuleHandlerFunc`""></a></h3><ul><li><p><strong>说明</strong>:规则函数签名</p></li><li><p><strong>类型</strong>:<code>TypeAlias</code></p></li><li><p><strong>默认值</strong>:<code>Callable[[MessageEvent],Coroutine[None,None,bool]]</code></p></li></ul><h3id="class-rule"tabindex="-1"><em><strong>class</strong></em><code>Rule</code><aclass="header-anchor"href="#class-rule"aria-label="Permalinkto"***class***`Rule`""></a></h3><h4id="def-init-self-handler-rulehandlerfunc"tabindex="-1"><em><strong>def</strong></em><code>__init__(self,handler:RuleHandlerFunc)</code><aclass="header-anchor"href="#def-init-self-handler-rulehandlerfunc"aria-label="Permalinkto"***def***`__init__(self,handler:RuleHandlerFunc)`""></a></h4><details><summary><b>源代码</b>或<ahref="https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/message/rule.py#L24"target="_blank">在GitHub上查看</a></summary><divclass="language-pythonvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">python</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"tabindex="0"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__init__</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self,handler:RuleHandlerFunc):</span></span>\n<spanclass="line"><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">self</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.handler</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">handler</span></span></code></pre></div></details><h4id="def-or-self-other-rule-rule"tabindex="-1"><em><strong>def</strong></em><code>__or__(self,other:Rule)->Rule</code><aclass="header-anchor"href="#def-or-self-other-rule-rule"aria-label="Permalinkto"***def***`__or__(self,other:Rule)->Rule`""></a></h4><details><summary><b>源代码</b>或<ahref="https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/message/rule.py#L27"target="_blank">在GitHub上查看</a></summary><divclass="language-pythonvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">python</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"tabindex="0"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">__or__</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self,other:</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Rule'</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)-></span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Rule'</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<spanclass="line"></span>\n<spanclass="line"><spanstyle="--shiki-light:#D7