Changing references from container to server and adding map functionality

This commit is contained in:
luke 2018-04-26 08:49:45 -07:00
parent 9f1c15b646
commit dab72d2455

View File

@ -327,7 +327,7 @@ async def on_message(message):
) )
if message.content.startswith('!docker'): if message.content.startswith('!minecraft'):
# Check permissions # Check permissions
if not role_check.docker_permissions(message.author.roles): if not role_check.docker_permissions(message.author.roles):
await client.send_message( await client.send_message(
@ -337,7 +337,7 @@ async def on_message(message):
return return
if len(message.content.split()) == 1: if len(message.content.split()) == 1:
actions = ['restart', 'status', 'logs'] actions = ['restart', 'status', 'logs', 'map']
await client.send_message( await client.send_message(
message.channel, message.channel,
"\nSupported actions:```\n{}```".format(", ".join(actions)) "\nSupported actions:```\n{}```".format(", ".join(actions))
@ -349,7 +349,7 @@ async def on_message(message):
except: except:
await client.send_message( await client.send_message(
message.channel, message.channel,
"The minecraft container is not running" "The minecraft server is not running"
) )
return return
@ -358,7 +358,7 @@ async def on_message(message):
if action == 'restart': if action == 'restart':
await client.send_message( await client.send_message(
message.channel, message.channel,
"{}, restart the container? [!yes/!no]".format( "{}, restart the server? [!yes/!no]".format(
message.author.mention) message.author.mention)
) )
@ -371,7 +371,7 @@ async def on_message(message):
if confirm_restart: if confirm_restart:
await client.send_message( await client.send_message(
message.channel, message.channel,
"Sending restart action to {} container".format( "Sending restart action to {} server".format(
minecraft_container.name minecraft_container.name
) )
) )
@ -381,7 +381,7 @@ async def on_message(message):
if action == 'status': if action == 'status':
await client.send_message( await client.send_message(
message.channel, message.channel,
"{} container is {}".format( "{} server is {}".format(
minecraft_container.name, minecraft_container.name,
minecraft_container.status minecraft_container.status
) )
@ -400,7 +400,7 @@ async def on_message(message):
if len(log_stream) >= num_lines: if len(log_stream) >= num_lines:
await client.send_message( await client.send_message(
message.channel, message.channel,
"Pulling last {} lines from {} container".format( "Pulling last {} lines from the {} server ".format(
num_lines, num_lines,
minecraft_container.name minecraft_container.name
) )
@ -420,5 +420,11 @@ async def on_message(message):
message.channel, message.channel,
"There arent {} lines of output yet".format(num_lines) "There arent {} lines of output yet".format(num_lines)
) )
if action == 'map':
await client.send_message(
message.channel,
"http://luker.zzzz.io/minecraft"
)
client.run(tokens[dragon_environment]) client.run(tokens[dragon_environment])