匹配消息纯文本开头。 参数: msg: 指定消息开头字符串元组 ignorecase: 是否忽略大小写
(msg: str | tuple[str, ...], ignorecase: bool = False)
| 178 | |
| 179 | |
| 180 | def startswith(msg: str | tuple[str, ...], ignorecase: bool = False) -> Rule: |
| 181 | """匹配消息纯文本开头。 |
| 182 | |
| 183 | 参数: |
| 184 | msg: 指定消息开头字符串元组 |
| 185 | ignorecase: 是否忽略大小写 |
| 186 | """ |
| 187 | if isinstance(msg, str): |
| 188 | msg = (msg,) |
| 189 | |
| 190 | return Rule(StartswithRule(msg, ignorecase)) |
| 191 | |
| 192 | |
| 193 | class EndswithRule: |