From 771d1b78e4ed6354f523e5d38cd6073107affcf2 Mon Sep 17 00:00:00 2001 From: PC-Admin Date: Fri, 18 Aug 2023 17:27:56 +0800 Subject: [PATCH] parse usernames in new rate limiting functions --- user_commands.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_commands.py b/user_commands.py index cce4605..5b950c2 100644 --- a/user_commands.py +++ b/user_commands.py @@ -432,6 +432,7 @@ def list_account_pushers(preset_username): def get_rate_limit(): username = input("\nPlease enter the username to get its ratelimiting: ") + username = parse_username(username) url = f"https://{hardcoded_variables.homeserver_url}/_synapse/admin/v1/users/@{username}:{hardcoded_variables.base_url}/override_ratelimit?access_token={hardcoded_variables.access_token}" @@ -450,6 +451,7 @@ def get_rate_limit(): def set_rate_limit(): username = input("\nPlease enter the username to adjust its ratelimiting: ") + username = parse_username(username) messages_per_second = input("\nPlease enter the desired messages per second: ") burst_count = input("\nPlease enter the desired burst count: ") @@ -478,6 +480,7 @@ def set_rate_limit(): def delete_rate_limit(): username = input("\nPlease enter the username to delete its ratelimiting: ") + username = parse_username(username) url = f"https://{hardcoded_variables.homeserver_url}/_synapse/admin/v1/users/@{username}:{hardcoded_variables.base_url}/override_ratelimit?access_token={hardcoded_variables.access_token}"