Update main.py

This commit is contained in:
Florian SYLVAIN
2021-03-13 19:37:51 +01:00
parent b8ab5e6755
commit 514ba57122
+4 -3
View File
@@ -48,9 +48,10 @@ async def unloadext(ctx, extension):
@bot.command(hidden=True) @bot.command(hidden=True)
@commands.is_owner() @commands.is_owner()
async def update(ctx): async def update(ctx):
result = os.popen('git pull') result = str(os.popen('git pull').read())
await ctx.send(str(result.read())) await ctx.send('``' + result + '``')
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv) if 'Already up to date' not in result:
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
if __name__ == "__main__": if __name__ == "__main__":