From 51511111cda667da39abb0ea0fcb88c78d19ded4 Mon Sep 17 00:00:00 2001 From: Benjamin Morgan Date: Fri, 25 Sep 2026 23:45:07 -0600 Subject: [PATCH] Resolve issues after adding query port --- src/mstbot.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/mstbot.py b/src/mstbot.py index 99a292b..09814e3 100644 --- a/src/mstbot.py +++ b/src/mstbot.py @@ -173,8 +173,8 @@ class Other(commands.Cog): @commands.command(brief="Shows server status", description="Shows server status.") async def status(self, ctx: discord.ext.commands.context.Context): with sqlite_conn() as conn: - ip, port = getMCIP(ctx.guild.id, conn) - mc = JavaServer(ip, port) + ip, port, query_port = getMCIP(ctx.guild.id, conn) + mc = JavaServer(ip, port, query_port) if mc is None: await safe_send("There is no server query set up. Run the `setup` command to get started.", ctx=ctx) @@ -193,8 +193,7 @@ class Other(commands.Cog): @commands.command(brief="Lists online players", description="Lists online players.") async def players(self, ctx: discord.ext.commands.context.Context): with sqlite_conn() as conn: - ip, port = getMCIP(ctx.guild.id, conn) - mc = JavaServer(ip, port) + mc = JavaServer(*getMCIP(ctx.guild.id, conn)) if mc is None: await safe_send("There is no server query set up. Run the `setup` command to get started.", ctx=ctx) @@ -211,8 +210,8 @@ class Other(commands.Cog): @commands.command(brief="Shows last query time", description="Shows last query time. Useful for debugging server connection issues.") async def lastquery(self, ctx: discord.ext.commands.context.Context): with sqlite_conn() as conn: - ip, port = getMCIP(ctx.guild.id, conn) - mc = JavaServer(ip, port) + ip, port, query_port = getMCIP(ctx.guild.id, conn) + mc = JavaServer(ip, port, query_port) last = getMCQueryTime(ctx.guild.id, conn) if mc is None: @@ -237,7 +236,7 @@ async def setAnn(ctx: discord.ext.commands.context.Context, ann: bool, cid: Unio return with sqlite_conn() as conn: - ip, _ = getMCIP(ctx.guild.id, conn) + ip, _, _ = getMCIP(ctx.guild.id, conn) conn.execute(""" UPDATE servers @@ -259,7 +258,7 @@ async def setAnn(ctx: discord.ext.commands.context.Context, ann: bool, cid: Unio async def setShowHours(ctx: discord.ext.commands.context.Context, show_hours: bool): with sqlite_conn() as conn: - ip, _ = getMCIP(ctx.guild.id, conn) + ip, _, _ = getMCIP(ctx.guild.id, conn) conn.execute(""" UPDATE servers @@ -484,8 +483,8 @@ async def do_bot_cleanup(sid: int, ctx: Union[discord.ext.commands.context.Conte print(currServ.name, "Error: I don't have permission to delete channels.") with sqlite_conn() as conn: - ip, port = getMCIP(sid, conn) - mc = JavaServer(ip, port) + ip, port, query_port = getMCIP(sid, conn) + mc = JavaServer(ip, port, query_port) conn.execute("DELETE FROM servers WHERE id = ?", (sid,)) conn.execute("DELETE FROM names WHERE id = ?", (sid,))