import{_ as n,o as s,c as a,e}from"./app-275NBlFz.js";const t={},o=e(`
on_message(rule: Rule, priority: int, block: bool) -> Matcher
def on_message(rule: Rule=empty_rule, priority: int=0, block: bool=False) -> Matcher:
matcher = Matcher(rule, priority, block)
for (i, m) in enumerate(_matcher_list):
if m.priority < matcher.priority:
_matcher_list.insert(i, matcher)
break
else:
_matcher_list.append(matcher)
return matcher
on_keywords(keywords: list[str], rule: Any, priority: int, block: bool) -> Matcher
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)
on_keywords_rule(event: MessageEvent) -> None
@Rule
async def on_keywords_rule(event: MessageEvent):
return any((keyword in event.raw_message for keyword in keywords))
current_priority = -1
matcher = Matcher(rule, priority, block)
current_priority = matcher.priority