import{_ as n,o as a,c as s,e}from"./app-BvUYPzLF.js";const t={},o=e(`
说明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
@Time : 2024/8/19 下午10:52 @Author : snowykami @Email : snowykami@outlook.com @File : on.py @Software: PyCharm
源代码 或 在GitHub上查看
def add_matcher(matcher: Matcher):
for (i, m) in enumerate(_matcher_list):
if m.priority < matcher.priority:
_matcher_list.insert(i, matcher)
break
else:
_matcher_list.append(matcher)
源代码 或 在GitHub上查看
def on_message(rule: Rule=empty_rule, priority: int=0, block: bool=False) -> Matcher:
matcher = Matcher(rule, priority, block)
add_matcher(matcher)
return matcher
源代码 或 在GitHub上查看
def on_keywords(keywords: list[str], rule=empty_rule, priority: int=0, block: bool=False) -> Matcher:
@Rule
async def on_keywords_rule(event: MessageEvent):
return any((keyword in event.raw_message for keyword in keywords))
return on_message(on_keywords_rule & rule, priority, block)
`,9),p=[o];function i(l,r){return a(),s("div",null,p)}const u=n(t,[["render",i],["__file","on.html.vue"]]),d=JSON.parse('{"path":"/dev/api/message/on.html","title":"liteyuki.message.on","lang":"zh-CN","frontmatter":{"title":"liteyuki.message.on","lastUpdated":false,"description":"liteyuki.message.on 说明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved @Time : 2024/8/19 下午10:52 @Author : snowykami @Email : snowykami@outlook.com @File : on.py @S...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress-theme-hope-docs-demo.netlify.app/en/dev/api/message/on.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/message/on.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot 轻雪机器人"}],["meta",{"property":"og:title","content":"liteyuki.message.on"}],["meta",{"property":"og:description","content":"liteyuki.message.on 说明: Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved @Time : 2024/8/19 下午10:52 @Author : snowykami @Email : snowykami@outlook.com @File : on.py @S..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-08-29T06:19:39.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-29T06:19:39.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.message.on\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-29T06:19:39.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":3,"title":"def add_matcher(matcher: Matcher)","slug":"def-add-matcher-matcher-matcher","link":"#def-add-matcher-matcher-matcher","children":[]},{"level":3,"title":"def on_message(rule: Rule = empty_rule, priority: int = 0, block: bool = False) -> Matcher","slug":"def-on-message-rule-rule-empty-rule-priority-int-0-block-bool-false-matcher","link":"#def-on-message-rule-rule-empty-rule-priority-int-0-block-bool-false-matcher","children":[]},{"level":3,"title":"def on_keywords(keywords: list[str], rule = empty_rule, priority: int = 0, block: bool = False) -> Matcher","slug":"def-on-keywords-keywords-list-str-rule-empty-rule-priority-int-0-block-bool-false-matcher","link":"#def-on-keywords-keywords-list-str-rule-empty-rule-priority-int-0-block-bool-false-matcher","children":[]}],"git":{"createdTime":1724234361000,"updatedTime":1724912379000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":2}]},"readingTime":{"minutes":0.69,"words":207},"filePathRelative":"dev/api/message/on.md","localizedDate":"2024年8月21日","autoDesc":true}');export{u as comp,d as data};