(self, event: Event, state: T_State)
| 218 | return hash((frozenset(self.msg), self.ignorecase)) |
| 219 | |
| 220 | async def __call__(self, event: Event, state: T_State) -> bool: |
| 221 | try: |
| 222 | text = event.get_plaintext() |
| 223 | except Exception: |
| 224 | return False |
| 225 | if match := re.search( |
| 226 | f"(?:{'|'.join(re.escape(suffix) for suffix in self.msg)})$", |
| 227 | text, |
| 228 | re.IGNORECASE if self.ignorecase else 0, |
| 229 | ): |
| 230 | state[ENDSWITH_KEY] = match.group() |
| 231 | return True |
| 232 | return False |
| 233 | |
| 234 | |
| 235 | def endswith(msg: str | tuple[str, ...], ignorecase: bool = False) -> Rule: |
nothing calls this directly
no test coverage detected