From 9323852e31bad3e0157c8bc1326b08baa594e26c Mon Sep 17 00:00:00 2001 From: AkriliksKotya Date: Sun, 21 Dec 2025 17:49:33 +0500 Subject: [PATCH] fix --- c/update.py | 10 +++++----- main.py | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/c/update.py b/c/update.py index 66839be..9a7a85e 100644 --- a/c/update.py +++ b/c/update.py @@ -17,12 +17,12 @@ class Update(commands.Cog): Make pull from git repository and restart """ - try: - res = await self.bot.ch(server_id=context.guild.id) - channel = self.bot.get_channel(res) - channel = int(channel) - except: + res = await self.bot.ch(server_id=context.guild.id) + channel = self.bot.get_channel(res) + if channel == "None": channel = context + else: + channel = int(channel) await channel.send('restarting...') try: subprocess.run(["git", "pull", "origin", "main"],capture_output=True) diff --git a/main.py b/main.py index e653dd0..f5ef245 100644 --- a/main.py +++ b/main.py @@ -48,8 +48,11 @@ class Bot(commands.Bot): tog = 1 rows = self.confmsg.execute("SELECT channel_id FROM channel WHERE name=? AND server_id=? AND tog=?",(name, server_id, tog)) res = rows.fetchone() - channel=" ".join(res) - return channel + if res == None: + return "None" + else: + channel=" ".join(res) + return channel async def select(self, name, server_id, channel_id) -> None: rows = self.confmsg.execute("SELECT tog FROM channel WHERE name=? AND server_id=? AND channel_id=?", (name, server_id, channel_id,))