import{_ as e,o as n,c as s,e as a}from"./app-Du8R6vOa.js";const t={},o=a(`

async def empty_rule(event: MessageEvent) -> bool

源代码
@Rule
async def empty_rule(event: MessageEvent) -> bool:
    return True

async def is_su_rule(event: MessageEvent) -> bool

源代码
@Rule
async def is_su_rule(event: MessageEvent) -> bool:
    return str(event.user_id) in _superusers

async def combined_handler(event: MessageEvent) -> bool

源代码
async def combined_handler(event: MessageEvent) -> bool:
    return await self.handler(event) or await other.handler(event)

async def combined_handler(event: MessageEvent) -> bool

源代码
async def combined_handler(event: MessageEvent) -> bool:
    return await self.handler(event) and await other.handler(event)

class Rule

def __init__(self, handler: RuleHandlerFunc) -> None

源代码
def __init__(self, handler: RuleHandlerFunc):
    self.handler = handler
`,12),l=[o];function p(c,i){return n(),s("div",null,l)}const r=e(t,[["render",p],["__file","rule.html.vue"]]),u=JSON.parse('{"path":"/en/dev/api/message/rule.html","title":"liteyuki.message.rule","lang":"en-US","frontmatter":{"title":"liteyuki.message.rule","order":1,"icon":"laptop-code","category":"API","description":"async def empty_rule(event: MessageEvent) -> bool 源代码 async def is_su_rule(event: MessageEvent) -> bool 源代码 async def combined_handler(event: MessageEvent) -> bool 源代码 async def...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/message/rule.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/dev/api/message/rule.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot"}],["meta",{"property":"og:title","content":"liteyuki.message.rule"}],["meta",{"property":"og:description","content":"async def empty_rule(event: MessageEvent) -> bool 源代码 async def is_su_rule(event: MessageEvent) -> bool 源代码 async def combined_handler(event: MessageEvent) -> bool 源代码 async def..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-21T09:59:21.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-21T09:59:21.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.message.rule\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-21T09:59:21.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":3,"title":"async def empty_rule(event: MessageEvent) -> bool","slug":"async-def-empty-rule-event-messageevent-bool","link":"#async-def-empty-rule-event-messageevent-bool","children":[]},{"level":3,"title":"async def is_su_rule(event: MessageEvent) -> bool","slug":"async-def-is-su-rule-event-messageevent-bool","link":"#async-def-is-su-rule-event-messageevent-bool","children":[]},{"level":3,"title":"async def combined_handler(event: MessageEvent) -> bool","slug":"async-def-combined-handler-event-messageevent-bool","link":"#async-def-combined-handler-event-messageevent-bool","children":[]},{"level":3,"title":"async def combined_handler(event: MessageEvent) -> bool","slug":"async-def-combined-handler-event-messageevent-bool-1","link":"#async-def-combined-handler-event-messageevent-bool-1","children":[]},{"level":3,"title":"class Rule","slug":"class-rule","link":"#class-rule","children":[]},{"level":3,"title":"def __init__(self, handler: RuleHandlerFunc) -> None","slug":"def-init-self-handler-rulehandlerfunc-none","link":"#def-init-self-handler-rulehandlerfunc-none","children":[]}],"git":{"createdTime":1724234361000,"updatedTime":1724234361000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":1}]},"readingTime":{"minutes":0.46,"words":139},"filePathRelative":"en/dev/api/message/rule.md","localizedDate":"August 21, 2024","autoDesc":true}');export{r as comp,u as data};