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

Method include

nonebot/internal/adapter/message.py:409–418  ·  view source on GitHub ↗

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

(self, *types: str)

Source from the content-addressed store, hash-verified

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 """过滤消息

Callers 1

test_message_includeFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_message_includeFunction · 0.64