Skip to content

Commit

Permalink
Added env variables for mc public ip and port
Browse files Browse the repository at this point in the history
  • Loading branch information
Antimatter543 committed Dec 23, 2023
1 parent 6422a1c commit dc2bebe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion uqcsbot/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit dc2bebe

Please sign in to comment.