From 576ea41d3707444901ad6177cf299df8a707b2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=95=98=EB=88=84?= Date: Thu, 23 Mar 2023 02:43:31 +0000 Subject: [PATCH] feat: add "New Day" achievement --- app.py | 2 ++ bot.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 931f9e7..0dabf81 100644 --- a/app.py +++ b/app.py @@ -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) diff --git a/bot.py b/bot.py index 7494914..35d128b 100644 --- a/bot.py +++ b/bot.py @@ -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: