From 845f306c8bc897c75a184c40e9e5a22375f617e4 Mon Sep 17 00:00:00 2001 From: Battlefield Duck Date: Fri, 3 Nov 2023 17:20:08 +0800 Subject: [PATCH] Update main.py --- discordgsm/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discordgsm/main.py b/discordgsm/main.py index 5a93604..c830681 100644 --- a/discordgsm/main.py +++ b/discordgsm/main.py @@ -269,8 +269,6 @@ async def modal_on_submit(interaction: Interaction): for item in params.values(): item.default = item._value = str(item._value).strip() - game_id, address, query_port = game['id'], str(query_param['host']), int(str(query_param['port'])) - # Validate the port number for key in params.keys(): if 'port' in key.lower() and not gamedig.is_port_valid(str(params[key])): @@ -280,6 +278,8 @@ async def modal_on_submit(interaction: Interaction): await interaction.response.defer(ephemeral=is_add_server, thinking=True) + game_id, address, query_port = game['id'], str(query_param['host']), int(str(query_param['port'])) + # Check is the server already exists in database if is_add_server: try: