From 32182dcb1f504b9a1969b651ccc88baa67bda003 Mon Sep 17 00:00:00 2001 From: 75efb6 <71222525+75efb6@users.noreply.github.com> Date: Fri, 17 Jan 2025 01:17:40 +0100 Subject: [PATCH 1/3] Remove useless stuff from wl add --- commands/whitelist_add.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/whitelist_add.py b/commands/whitelist_add.py index a07a970..4807851 100644 --- a/commands/whitelist_add.py +++ b/commands/whitelist_add.py @@ -48,8 +48,6 @@ async def _whitelist_add( item["beatmap_id"] for item in data if "beatmap_id" in item ] - ## Collect data from the second API for each ID - collected_data = [] for beatmap_id in beatmap_ids: ## Inserting maps into whitelist second_api_url = f"{config.domain}/api/wl_add?key={config.wl_key}&bid={beatmap_id}" @@ -57,8 +55,8 @@ async def _whitelist_add( if second_response.status == 200: pass else: - collected_data.append( - {"id": id, "error": "Failed to fetch details"} + await interaction.followup.send( + "Failed inserting maps to whitelist." ) await interaction.followup.send("Done.") From 84d3d0cdc2d19951d409eb7286434a906d1274fc Mon Sep 17 00:00:00 2001 From: 75efb6 <71222525+75efb6@users.noreply.github.com> Date: Fri, 17 Jan 2025 01:21:31 +0100 Subject: [PATCH 2/3] Update whitelist_remove.py --- commands/whitelist_remove.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/commands/whitelist_remove.py b/commands/whitelist_remove.py index 0f780b9..dd225be 100644 --- a/commands/whitelist_remove.py +++ b/commands/whitelist_remove.py @@ -48,8 +48,6 @@ async def _whitelist_remove( item["beatmap_id"] for item in data if "beatmap_id" in item ] - # Collect data from the second API for each ID - collected_data = [] for beatmap_id in beatmap_ids: ## Inserting maps into whitelist second_api_url = f"{config.domain}/api/wl_remove?key={config.wl_key}&bid={beatmap_id}" @@ -57,9 +55,9 @@ async def _whitelist_remove( if second_response.status == 200: pass else: - collected_data.append( - {"id": id, "error": "Failed to fetch details"} - ) + await interaction.followup.send( + "Failed to remove maps from whitelist." + ) await interaction.followup.send("Done.") else: From 6dd6425d6bf5d9d6442ec2cb6422218de7a6c92d Mon Sep 17 00:00:00 2001 From: 75efb6 <71222525+75efb6@users.noreply.github.com> Date: Fri, 17 Jan 2025 01:23:12 +0100 Subject: [PATCH 3/3] Update commands/whitelist_remove.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- commands/whitelist_remove.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/whitelist_remove.py b/commands/whitelist_remove.py index dd225be..6a701ab 100644 --- a/commands/whitelist_remove.py +++ b/commands/whitelist_remove.py @@ -56,8 +56,8 @@ async def _whitelist_remove( pass else: await interaction.followup.send( - "Failed to remove maps from whitelist." - ) + "Failed to remove maps from whitelist." + ) await interaction.followup.send("Done.") else: