From 58aacf362e6454ca8df9f78f981a87055333751c Mon Sep 17 00:00:00 2001 From: Raiden Sakura Date: Fri, 12 Apr 2024 21:24:00 +0800 Subject: [PATCH] Add change port command --- logviewer/logviewer.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/logviewer/logviewer.py b/logviewer/logviewer.py index 92ecd1b..d32b109 100644 --- a/logviewer/logviewer.py +++ b/logviewer/logviewer.py @@ -148,6 +148,16 @@ async def set_encryption_key(self, ctx: commands.Context, *, key: str): await ctx.message.delete() await ctx.send("Logviewer encryption key set.") + @logviewer_config.command(name="port") + @checks.has_permissions(PermissionLevel.OWNER) + async def set_port(self, ctx: commands.Context, port: int): + """ + Set the webserer port for Logviewer to listen on. Webserver must be restarted for this change to take effect. + """ + self.config["port"] = port + await self.update_config() + await ctx.send("Logviewer port set.") + @logviewer_config.group(name="remove", aliases=["reset", "delete"]) @checks.has_permissions(PermissionLevel.OWNER) async def remove_config(self, ctx: commands.Context):