1
0

feat: add "New Day" achievement

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

2
app.py
View File

@ -138,6 +138,8 @@ async def update_metadata(response: Response, code: str, steam_id: str = Cookie(
role.add_or_edit_metadata(key="tutorial", value=True)
if achieve["apiname"] == "go_to_bed":
role.add_or_edit_metadata(key="allperfect", value=True)
if achieve["apiname"] == "new_day":
role.add_or_edit_metadata(key="clear", value=True)
success += 1
percentage = round((success / total) * 100)
role.add_or_edit_metadata(key="percentage", value=percentage)

8
bot.py
View File

@ -33,6 +33,12 @@ async def _addConnection(inter: disnake.ApplicationCommandInteraction):
description="튜토리얼 스테이지를 퍼펙트로 클리어해야 합니다.",
type=RoleMetadataType.boolean_equal
),
RoleMetadataRecord(
key="clear",
name="New Day",
description="모든 스테이지를 클리어해야 합니다.",
type=RoleMetadataType.boolean_equal
),
RoleMetadataRecord(
key="allperfect",
name="Go to bed",
@ -50,7 +56,7 @@ async def _addConnection(inter: disnake.ApplicationCommandInteraction):
name="Percent of Achievement",
description="% 이상의 도전 과제를 달성해야 합니다.",
type=RoleMetadataType.interger_greater_than_or_equal
),
)
]
async with LinkedRolesOAuth2(client_id=os.getenv("CLIENT_ID"), token=os.getenv("BOT_TOKEN")) as client:
try: