diff --git a/.gitignore b/.gitignore index 90bc23f..c92c62e 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,6 @@ private.py # Generated JPEG File acc.jpeg + +# Script for CI +.sh diff --git a/python/main.py b/python/main.py index 7986b7a..3547a29 100644 --- a/python/main.py +++ b/python/main.py @@ -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)