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

Method _get_final_kwargs

nonebot/plugin/on.py:445–460  ·  view source on GitHub ↗

获取最终传递给 `on` 的参数 参数: update: 更新的关键字参数 exclude: 需要排除的参数

(
        self, update: dict[str, Any], *, exclude: set[str] | None = None
    )

Source from the content-addressed store, hash-verified

443 """其他传递给 `on` 的参数默认值"""
444
445 def _get_final_kwargs(
446 self, update: dict[str, Any], *, exclude: set[str] | None = None
447 ) -> dict[str, Any]:
448 """获取最终传递给 `on` 的参数
449
450 参数:
451 update: 更新的关键字参数
452 exclude: 需要排除的参数
453 """
454 final_kwargs = self.base_kwargs.copy()
455 final_kwargs.update(update)
456 if exclude:
457 for key in exclude:
458 final_kwargs.pop(key, None)
459 final_kwargs["_depth"] = 1
460 return final_kwargs
461
462
463class CommandGroup(_Group):

Callers 15

commandMethod · 0.80
shell_commandMethod · 0.80
onMethod · 0.80
on_metaeventMethod · 0.80
on_messageMethod · 0.80
on_noticeMethod · 0.80
on_requestMethod · 0.80
on_startswithMethod · 0.80
on_endswithMethod · 0.80
on_fullmatchMethod · 0.80
on_keywordMethod · 0.80
on_commandMethod · 0.80

Calls 3

popMethod · 0.80
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected