MCPcopy
hub / github.com/nonebot/nonebot2 / fullmatch

Function fullmatch

nonebot/rule.py:289–299  ·  view source on GitHub ↗

完全匹配消息。 参数: msg: 指定消息全匹配字符串元组 ignorecase: 是否忽略大小写

(msg: str | tuple[str, ...], ignorecase: bool = False)

Source from the content-addressed store, hash-verified

287
288
289def fullmatch(msg: str | tuple[str, ...], ignorecase: bool = False) -> Rule:
290 """完全匹配消息。
291
292 参数:
293 msg: 指定消息全匹配字符串元组
294 ignorecase: 是否忽略大小写
295 """
296 if isinstance(msg, str):
297 msg = (msg,)
298
299 return Rule(FullmatchRule(msg, ignorecase))
300
301
302class KeywordsRule:

Callers 2

on_fullmatchFunction · 0.90
test_fullmatchFunction · 0.90

Calls 2

RuleClass · 0.90
FullmatchRuleClass · 0.85

Tested by 1

test_fullmatchFunction · 0.72