Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

[錯誤回報] #66

Closed
soulcoord opened this issue Jul 26, 2022 · 2 comments
Closed

[錯誤回報] #66

soulcoord opened this issue Jul 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@soulcoord
Copy link

哪個指令出錯了?

/profile角色展示

如果可行的話,請告訴我重現該錯誤的步驟

更改語言成EN(英文)以後就無法使用

請貼上「除錯用訊息」

Traceback (most recent call last):
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 649, in _do_call
return await self._callback(self.binding, interaction, **params) # type: ignore
File "C:\Users\alice\shenhe_public\cogs\genshin.py", line 851, in profile
data: EnkaNetworkResponse = await enka_client.fetch_user(uid)
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\enkanetwork\client.py", line 65, in fetch_user
return EnkaNetworkResponse.parse_obj(data)
File "pydantic\main.py", line 521, in pydantic.main.BaseModel.parse_obj
File "pydantic\main.py", line 339, in pydantic.main.BaseModel.init
File "pydantic\main.py", line 1038, in pydantic.main.validate_model
File "pydantic\fields.py", line 857, in pydantic.fields.ModelField.validate
File "pydantic\fields.py", line 1074, in pydantic.fields.ModelField._validate_singleton
File "pydantic\fields.py", line 1121, in pydantic.fields.ModelField._apply_validators
File "pydantic\class_validators.py", line 313, in pydantic.class_validators._generic_validator_basic.lambda12
File "pydantic\main.py", line 686, in pydantic.main.BaseModel.validate
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\enkanetwork\model\players.py", line 119, in init
super().init(**data)
File "pydantic\main.py", line 339, in pydantic.main.BaseModel.init
File "pydantic\main.py", line 1038, in pydantic.main.validate_model
File "pydantic\fields.py", line 857, in pydantic.fields.ModelField.validate
File "pydantic\fields.py", line 1074, in pydantic.fields.ModelField._validate_singleton
File "pydantic\fields.py", line 1121, in pydantic.fields.ModelField._apply_validators
File "pydantic\class_validators.py", line 313, in pydantic.class_validators._generic_validator_basic.lambda12
File "pydantic\main.py", line 686, in pydantic.main.BaseModel.validate
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\enkanetwork\model\players.py", line 26, in init
icon = Assets.character_icon(str(data["avatarId"]))
KeyError: 'avatarId'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\tree.py", line 1157, in call
await command._invoke_with_namespace(interaction, namespace)
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 675, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
File "C:\Users\alice\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 668, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'profile角色展示' raised an exception: KeyError: 'avatarId'

如果方便的話,請留下你的 dc tag

櫻花冰棒#1190

@soulcoord soulcoord added the bug Something isn't working label Jul 26, 2022
@seriaati
Copy link
Owner

seriaati commented Jul 26, 2022

這跟語言調整成英文沒有關係,這是因為你提供的 UID (902084057) 還沒有選擇角色

@seriaati
Copy link
Owner

這是你的 enka 資料:https://enka.network/u/902084057/__data.json
裡面是空的
在 wrapper 的製作者更新前我會先釋出修補去抓這個錯誤

@seriaati seriaati reopened this Jul 26, 2022
seriaati pushed a commit that referenced this issue Jul 26, 2022
@seriaati seriaati self-assigned this Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants