mirror of
https://github.com/opus-tango/minecraft-server-discord-bot.git
synced 2026-03-20 03:55:20 +00:00
add check for running server when starting new server
This commit is contained in:
5
bot.py
5
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)
|
||||
|
||||
Reference in New Issue
Block a user