mirror of
https://github.com/Floriansylvain/Risitas_BOT.git
synced 2026-08-19 11:43:16 +02:00
✨ - Introducing "update" command for CI purpose
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user