fix
This commit is contained in:
10
c/update.py
10
c/update.py
@@ -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)
|
if channel == "None":
|
||||||
channel = int(channel)
|
|
||||||
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)
|
||||||
|
|||||||
7
main.py
7
main.py
@@ -48,8 +48,11 @@ 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()
|
||||||
channel=" ".join(res)
|
if res == None:
|
||||||
return channel
|
return "None"
|
||||||
|
else:
|
||||||
|
channel=" ".join(res)
|
||||||
|
return channel
|
||||||
|
|
||||||
async def select(self, name, server_id, channel_id) -> None:
|
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,))
|
rows = self.confmsg.execute("SELECT tog FROM channel WHERE name=? AND server_id=? AND channel_id=?", (name, server_id, channel_id,))
|
||||||
|
|||||||
Reference in New Issue
Block a user