From 302d93a0489d2e4f2dc83b04622a713547e690b9 Mon Sep 17 00:00:00 2001 From: Nayan <33187059+GShadow5@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:28:41 -0400 Subject: [PATCH] add check for running server when starting new server --- README.md | 2 +- bot.py | 5 +++++ config.json | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a665e4d..2c8ff55 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bot.py b/bot.py index 18d30a3..3fbee1a 100644 --- a/bot.py +++ b/bot.py @@ -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) diff --git a/config.json b/config.json index 664b27f..1f12a09 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "config": { - "chat_channel": "minecraft", - "command_channel": "minecraft", + "chat_channel": "testchatchannel", + "command_channel": "testchatchannel", "command_prefix": "!" } } \ No newline at end of file