From dc2bebe74055aa3ee0e12fb02441867f0b914d30 Mon Sep 17 00:00:00 2001 From: Anti Matter Date: Sun, 24 Dec 2023 09:11:59 +1000 Subject: [PATCH] Added env variables for mc public ip and port --- uqcsbot/minecraft.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uqcsbot/minecraft.py b/uqcsbot/minecraft.py index fc394ff..d2113f9 100644 --- a/uqcsbot/minecraft.py +++ b/uqcsbot/minecraft.py @@ -17,6 +17,8 @@ RCON_PORT = os.environ.get("MC_RCON_PORT") RCON_PASSWORD = os.environ.get("MC_RCON_PASSWORD") +MC_PUBLIC_IP = os.environ.get("MC_PUBLIC_IP") +MC_PUBLIC_PORT = os.environ.get("MC_PUBLIC_PORT") class Minecraft(commands.Cog): def __init__(self, bot: UQCSBot): @@ -53,7 +55,7 @@ async def send_rcon_command(self, command: str): async def mcplayers(self, interaction: discord.Interaction): """Returns the number and list of people currently playing on the Minecraft server.""" server = JavaServer.lookup( - "minecraft.uqcs.org:25605" + f"{MC_PUBLIC_IP}:{MC_PUBLIC_PORT}" ) # Does this need to be hard coded?? Is RCON addr/IP the same? status = server.status() # type: ignore