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

func add_matcher()

Source code
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)

func on_message(rule: Rule = empty_rule, priority: int = 0, block: bool = False) -> Matcher

Source code
def on_message(rule: Rule=empty_rule, priority: int=0, block: bool=False) -> Matcher:
    matcher = Matcher(rule, priority, block)
    add_matcher(matcher)
    return matcher

func on_keywords(keywords: list[str] = empty_rule, rule = 0, priority: int = False) -> Matcher

Source code
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)

var _matcher_list = []

var _queue = Queue()

`,10),p=[o];function l(c,r){return s(),a("div",null,p)}const u=n(t,[["render",l],["__file","on.html.vue"]]),d=JSON.parse('{"path":"/en/api/message/on.html","title":"liteyuki.message.on","lang":"en-US","frontmatter":{"title":"liteyuki.message.on","description":"func add_matcher() Source code func on_message(rule: Rule = empty_rule, priority: int = 0, block: bool = False) -> Matcher Source code func on_keywords(keywords: list[str] = emp...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress-theme-hope-docs-demo.netlify.app/api/message/on.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/api/message/on.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot"}],["meta",{"property":"og:title","content":"liteyuki.message.on"}],["meta",{"property":"og:description","content":"func add_matcher() Source code func on_message(rule: Rule = empty_rule, priority: int = 0, block: bool = False) -> Matcher Source code func on_keywords(keywords: list[str] = emp..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.message.on\\",\\"image\\":[\\"\\"],\\"dateModified\\":null,\\"author\\":[]}"]]},"headers":[{"level":3,"title":"func add_matcher()","slug":"func-add-matcher","link":"#func-add-matcher","children":[]},{"level":3,"title":"func on_message(rule: Rule = empty_rule, priority: int = 0, block: bool = False) -> Matcher","slug":"func-on-message-rule-rule-empty-rule-priority-int-0-block-bool-false-matcher","link":"#func-on-message-rule-rule-empty-rule-priority-int-0-block-bool-false-matcher","children":[]},{"level":3,"title":"func on_keywords(keywords: list[str] = empty_rule, rule = 0, priority: int = False) -> Matcher","slug":"func-on-keywords-keywords-list-str-empty-rule-rule-0-priority-int-false-matcher","link":"#func-on-keywords-keywords-list-str-empty-rule-rule-0-priority-int-false-matcher","children":[]},{"level":3,"title":"var _matcher_list = []","slug":"var-matcher-list","link":"#var-matcher-list","children":[]},{"level":3,"title":"var _queue = Queue()","slug":"var-queue-queue","link":"#var-queue-queue","children":[]}],"git":{"createdTime":null,"updatedTime":null,"contributors":[]},"readingTime":{"minutes":0.47,"words":141},"filePathRelative":"en/api/message/on.md","autoDesc":true}');export{u as comp,d as data};