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

Method exclude

nonebot/internal/adapter/message.py:420–429  ·  view source on GitHub ↗

过滤消息 参数: types: 不包含的消息段类型 返回: 新构造的消息

(self, *types: str)

Source from the content-addressed store, hash-verified

418 return self.__class__(seg for seg in self if seg.type in types)
419
420 def exclude(self, *types: str) -> Self:
421 """过滤消息
422
423 参数:
424 types: 不包含的消息段类型
425
426 返回:
427 新构造的消息
428 """
429 return self.__class__(seg for seg in self if seg.type not in types)
430
431 def extract_plain_text(self) -> str:
432 """提取消息内纯文本消息"""

Callers 1

test_message_excludeFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_message_excludeFunction · 0.64