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

View File

@@ -13,7 +13,7 @@ Commands:
!ping - Pings the bot
-Add currently running server variable
Add running server check to prevent multiple servers running
-Add running server check to prevent multiple servers running
-Add list command to see currently running servers
-Add server stop command
-Add server command command

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)

View File

@@ -1,7 +1,7 @@
{
"config": {
"chat_channel": "minecraft",
"command_channel": "minecraft",
"chat_channel": "testchatchannel",
"command_channel": "testchatchannel",
"command_prefix": "!"
}
}