Add system refresh command

This commit is contained in:
Zeva Rose 2021-06-29 20:51:03 -06:00
parent e500004148
commit b1096a6f92

View file

@ -1,7 +1,7 @@
import jarvis import jarvis
import discord import discord
from discord.ext import commands from discord.ext import commands
from jarvis.config import get_config from jarvis.config import get_config, reload_config
from jarvis.utils import update, user_is_bot_admin from jarvis.utils import update, user_is_bot_admin
@ -144,6 +144,12 @@ class OwnerCog(commands.Cog):
else: else:
await ctx.send("I'm afraid I can't let you do that") await ctx.send("I'm afraid I can't let you do that")
@_system.command(name="refresh", hidden=True)
@user_is_bot_admin()
async def _refresh(self, ctx):
reload_config()
await ctx.send("System refreshed")
@commands.Cog.listener() @commands.Cog.listener()
async def on_command_error(self, ctx, error): async def on_command_error(self, ctx, error):
if isinstance(error, commands.errors.MissingPermissions): if isinstance(error, commands.errors.MissingPermissions):