We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"application_commands": {"*": ["*"]}
TypeError
2.2.1
0.1.4
2.6.3
2.16.3
Traceback (most recent call last): File "<string>", line 17, in <module> File ".venv\Lib\site-packages\nonebot\internal\driver\abstract.py", line 79, in register_adapter self._adapters[name] = adapter(self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File ".venv\Lib\site-packages\nonebot\adapters\discord\adapter.py", line 43, in __init__ self.discord_config: Config = get_plugin_config(Config) ^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv\Lib\site-packages\nonebot\plugin\__init__.py", line 120, in get_plugin_config return type_validate_python(config, model_dump(get_driver().config)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv\Lib\site-packages\nonebot\compat.py", line 215, in type_validate_python return TypeAdapter(type_).validate_python(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv\Lib\site-packages\pydantic\type_adapter.py", line 256, in validate_python return self.validator.validate_python(__object, strict=strict, from_attributes=from_attributes, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv\Lib\site-packages\nonebot\adapters\discord\api\model.py", line 113, in validate raise TypeError(f"{value!r} is not int or str of int") TypeError: '*' is not int or str of int
.env
application_commands
"application_commands": {"*": [123]}
以上两种情况不会报错,只要 [] 里包含 "*" 就会报错
[]
"*"
adapter-discord/nonebot/adapters/discord/config.py
Lines 57 to 59 in 6c9a24b
Union
Union[Literal["*"], Snowflake]
🤔十分神奇,请求支援
The text was updated successfully, but these errors were encountered:
应该是pydantic v1和v2的union机制不同,方便开个pr调整一下union顺序吗
Sorry, something went wrong.
🐛 修复配置项 application_commands 为 {"*": ["*"]} 时抛出 TypeError #16 (#17
{"*": ["*"]}
8869bb0
)
No branches or pull requests
版本
2.2.1
0.1.4
2.6.3
2.16.3
log
尝试
.env
里删去application_commands
"application_commands": {"*": [123]}
以上两种情况不会报错,只要
[]
里包含"*"
就会报错adapter-discord/nonebot/adapters/discord/config.py
Lines 57 to 59 in 6c9a24b
尝试把此处的
Union
写成Union[Literal["*"], Snowflake]
就不会报错🤔十分神奇,请求支援
The text was updated successfully, but these errors were encountered: