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

Method format_map

nonebot/internal/adapter/template.py:84–86  ·  view source on GitHub ↗

根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用

(self, mapping: Mapping[str, Any])

Source from the content-addressed store, hash-verified

82 return self._format(args, kwargs)
83
84 def format_map(self, mapping: Mapping[str, Any]) -> TF:
85 """根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用"""
86 return self._format([], mapping)
87
88 def _format(self, args: Sequence[Any], kwargs: Mapping[str, Any]) -> TF:
89 full_message = self.factory()

Callers 1

test_template_messageFunction · 0.80

Calls 1

_formatMethod · 0.95

Tested by 1

test_template_messageFunction · 0.64