过滤消息 参数: types: 包含的消息段类型 返回: 新构造的消息
(self, *types: str)
| 407 | return deepcopy(self) |
| 408 | |
| 409 | def include(self, *types: str) -> Self: |
| 410 | """过滤消息 |
| 411 | |
| 412 | 参数: |
| 413 | types: 包含的消息段类型 |
| 414 | |
| 415 | 返回: |
| 416 | 新构造的消息 |
| 417 | """ |
| 418 | return self.__class__(seg for seg in self if seg.type in types) |
| 419 | |
| 420 | def exclude(self, *types: str) -> Self: |
| 421 | """过滤消息 |
no outgoing calls