This commit is contained in:
2025-12-21 17:49:33 +05:00
parent 0cec709205
commit 9323852e31
2 changed files with 10 additions and 7 deletions

View File

@@ -17,12 +17,12 @@ class Update(commands.Cog):
Make pull from git repository and restart Make pull from git repository and restart
""" """
try:
res = await self.bot.ch(server_id=context.guild.id) res = await self.bot.ch(server_id=context.guild.id)
channel = self.bot.get_channel(res) channel = self.bot.get_channel(res)
channel = int(channel) if channel == "None":
except:
channel = context channel = context
else:
channel = int(channel)
await channel.send('restarting...') await channel.send('restarting...')
try: try:
subprocess.run(["git", "pull", "origin", "main"],capture_output=True) subprocess.run(["git", "pull", "origin", "main"],capture_output=True)

View File

@@ -48,6 +48,9 @@ class Bot(commands.Bot):
tog = 1 tog = 1
rows = self.confmsg.execute("SELECT channel_id FROM channel WHERE name=? AND server_id=? AND tog=?",(name, server_id, tog)) rows = self.confmsg.execute("SELECT channel_id FROM channel WHERE name=? AND server_id=? AND tog=?",(name, server_id, tog))
res = rows.fetchone() res = rows.fetchone()
if res == None:
return "None"
else:
channel=" ".join(res) channel=" ".join(res)
return channel return channel