mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 07:09:50 +00:00
✨ 优化参数处理逻辑,添加默认值支持;更新天气获取函数的返回信息
This commit is contained in:
@ -131,6 +131,12 @@ class Caller:
|
||||
param.annotation, Caller
|
||||
):
|
||||
kwargs[name] = self
|
||||
|
||||
# 检查形参是否有默认值或传入,若没有则用parameters中的默认值填充
|
||||
for name, param in sig.parameters.items():
|
||||
if name not in kwargs:
|
||||
kwargs[name] = self._parameters.get(name, param.default)
|
||||
|
||||
return await self.func(*args, **kwargs)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user