- Introducing "update" command for CI purpose

This commit is contained in:
Florian SYLVAIN
2021-03-13 19:04:45 +01:00
parent 9bed489ca9
commit 399190a45a
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -3,6 +3,7 @@ from time import time
from datetime import datetime
from discord.ext import commands
from miscellaneous import spellchecker
import os, sys
import discord
@@ -44,6 +45,14 @@ async def unloadext(ctx, extension):
await ctx.send("Extension unloaded.")
@bot.command(hidden=True)
@commands.is_owner()
async def update(ctx):
result = os.popen('git pull')
await ctx.send(str(result.read()))
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
if __name__ == "__main__":
for extension in startup_extensions:
bot.load_extension('ext.' + extension)