def update(self, ctx):
"""
Updates the bot from the Github repo
"""
await ctx.send("Calling process to update! :up: :date: ")
try:
done = subprocess.run("git pull", shell=True, stdout=subprocess.PIPE, timeout=30)
if done:
message = done.stdout.decode()
await ctx.send("`{}`".format(message))
if message == "Already up-to-date.\n":
await ctx.send("No update available :no_entry:")
else:
await ctx.send("Succesfully updated! Rebooting now :repeat: ")
await self.bot.logout()
except subprocess.CalledProcessError:
await ctx.send("Error updating! :exclamation: ")
except subprocess.TimeoutExpired:
await ctx.send("Error updating - Process timed out! :exclamation: ")
评论列表
文章目录