Skip to content

Commit

Permalink
fix: 原神 UID 長度限制增加至 10 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
KT-Yeh committed Mar 23, 2024
1 parent 6dd3c30 commit 4a3f3c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cogs/showcase/ui_genshin.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async def showcase(
title="找不到角色UID",
)
)
elif len(str(uid)) != 9 or str(uid)[0] not in ["1", "2", "5", "6", "7", "8", "9"]:
elif len(str(uid)) < 9 or len(str(uid)) > 10 or str(uid)[0] not in ["1", "2", "5", "6", "7", "8", "9"]:
await interaction.edit_original_response(embed=EmbedTemplate.error("輸入的UID格式錯誤"))
else:
showcase = Showcase(uid)
Expand Down
4 changes: 2 additions & 2 deletions cogs/uid_setting/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def __init__(self, game: genshin.Game) -> None:

uid: discord.ui.TextInput[discord.ui.Modal] = discord.ui.TextInput(
label="UID",
placeholder="請輸入遊戲內的UID(9位數字)",
placeholder="請輸入遊戲內的UID(9或10位數字)",
required=True,
min_length=9,
max_length=9,
max_length=10,
)

async def on_submit(self, interaction: discord.Interaction):
Expand Down

0 comments on commit 4a3f3c7

Please sign in to comment.