Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 719371a

Browse files
committed
修正錯誤
1 parent b50b4f2 commit 719371a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

cogs/profileCard/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def cog_unload(self):
3939
async def get_profile(self, server: int, uid: int, cache: bool = True):
4040
async with self.session.get(
4141
f"{self.apiUrl}/profile",
42-
params={"server": server, "uid": uid, "cache": "true" if cache else "false"},
42+
params={"server": server, "uid": str(uid).zfill(9), "cache": "true" if cache else "false"},
4343
) as resp:
4444
data = await resp.json()
4545

46-
self.logger.info(f"get_profile /{server}/{uid}: {resp.status}")
46+
self.logger.info(f"get_profile /{server}/{uid:09d}: {resp.status}")
4747

4848
if resp.status == 404:
4949
raise errors.ProfileNotFound
@@ -131,7 +131,6 @@ async def _bind(self, ctx: Union[Context, SlashContext], server: int, uid: str):
131131
async def pref_user_link_uid(self, ctx: ComponentContext):
132132
# s = server, i = uid, v = verify_code, t = created_at
133133
data = un_pref_custom_id(custom_id="user.link_uid", data=ctx.custom_id)
134-
data["i"] = data["i"].zfill(9)
135134

136135
if datetime.now().timestamp() > data["t"] + 120:
137136
return await ctx.edit_origin(content="此驗證已過期", components=None)

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from utils.state_manger import StateManger, State
1616

1717
__author__ = "IanDesuyo"
18-
__version__ = "3.1.7"
18+
__version__ = "3.1.8"
1919

2020

2121
class AIKyaru(AutoShardedBot):

utils/fetch_rank.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ async def emonight(self):
6666
emonight = {}
6767
emonight["preferRank"] = row[cols["preferRank"]]["v"].replace("\n", " ")
6868
emonight["preferRarity"] = row[cols["preferRarity"]]["v"].replace("\n", " ") if cols.get("preferRarity") and row[cols["preferRarity"]] else "-"
69-
emonight["comment"] = row[cols["comment"]]["v"].replace("\n", "")
69+
emonight["comment"] = row[cols["comment"]]["v"].replace("\n", "") if row[cols["comment"]] else "-"
7070
emonight["pvp"] = row[cols["pvp"]]["v"] if row[cols["pvp"]] else "天下無雙"
7171
emonight["cb"] = row[cols["cb"]]["v"] if row[cols["cb"]] else "天下無雙"
7272
row_result["emonight"] = emonight
7373

74-
row_result["attackRange"] = row[cols["attackRange"]]["v"]
74+
row_result["attackRange"] = row[cols["attackRange"]]["v"] if row[cols["attackRange"]] else "-"
7575
row_diff["hp"] = self.get_value(row[cols["hp"]])
7676
row_diff["atk"] = self.get_value(row[cols["atk"]])
7777
row_diff["magic_str"] = self.get_value(row[cols["magic_str"]])

0 commit comments

Comments
 (0)