1
0

fix: key error

This commit is contained in:
オスカー、 2023-03-23 02:48:07 +00:00 committed by GitHub
parent 576ea41d37
commit afd100af27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

6
app.py
View File

@ -135,11 +135,11 @@ async def update_metadata(response: Response, code: str, steam_id: str = Cookie(
async for achieve in async_list(data["achievements"]):
if achieve["achieved"] == 1:
if achieve["apiname"] == "honor_roll":
role.add_or_edit_metadata(key="tutorial", value=True)
role.add_or_edit_metadata(key="honor_roll", value=True)
if achieve["apiname"] == "go_to_bed":
role.add_or_edit_metadata(key="allperfect", value=True)
role.add_or_edit_metadata(key="go_to_bed", value=True)
if achieve["apiname"] == "new_day":
role.add_or_edit_metadata(key="clear", value=True)
role.add_or_edit_metadata(key="new_day", value=True)
success += 1
percentage = round((success / total) * 100)
role.add_or_edit_metadata(key="percentage", value=percentage)

6
bot.py
View File

@ -28,19 +28,19 @@ async def _addConnection(inter: disnake.ApplicationCommandInteraction):
await inter.response.defer(ephemeral=True)
records = [
RoleMetadataRecord(
key="tutorial",
key="honor_roll",
name="Honor roll",
description="튜토리얼 스테이지를 퍼펙트로 클리어해야 합니다.",
type=RoleMetadataType.boolean_equal
),
RoleMetadataRecord(
key="clear",
key="new_day",
name="New Day",
description="모든 스테이지를 클리어해야 합니다.",
type=RoleMetadataType.boolean_equal
),
RoleMetadataRecord(
key="allperfect",
key="go_to_bed",
name="Go to bed",
description="모든 스테이지를 퍼펙트로 클리어해야 합니다.",
type=RoleMetadataType.boolean_equal