add check for running server when starting new server

This commit is contained in:
Nayan
2025-08-25 21:28:41 -04:00
parent 1352947ae3
commit 302d93a048
3 changed files with 8 additions and 3 deletions

5
bot.py
View File

@@ -81,6 +81,11 @@ async def startserver(ctx, *args):
return
servername = args[0]
# Check if the server is already running
if active_server is not None:
await ctx.send("A server is already running. If you think this is an error, run !list to refresh the list of servers and try again.")
return
# Load server data from json
with open('servers.json', 'r') as f:
servers = json.load(f)