From 9f5cc9bb49ee0186118de7c0d0099904715e11f7 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Fri, 9 Aug 2024 14:03:53 +0100 Subject: [PATCH] Allow reloading the config on the $sync command This lets us keep higher uptime if needed --- matchy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matchy.py b/matchy.py index 547ac09..edbfacc 100755 --- a/matchy.py +++ b/matchy.py @@ -1,6 +1,7 @@ import discord import random import logging +import importlib from discord import app_commands from discord.ext import commands import util @@ -37,6 +38,9 @@ async def on_ready(): @commands.dm_only() async def sync(ctx: discord.ext.commands.context.Context): """Handle sync command""" + # Reload the config first + importlib.reload(config) + logger.info(f"Reloaded config") # Sync the commands with the discord API synced = await bot.tree.sync() logger.info(f"Synced {len(synced)} command(s)")