diff --git a/src/config/config.yaml.example b/src/config/config.yaml.example index 3c6870f..d2343c9 100644 --- a/src/config/config.yaml.example +++ b/src/config/config.yaml.example @@ -1,3 +1,5 @@ +config_mode: dev + # Bot settings bot: token: diff --git a/src/run.py b/src/run.py index 5fbb194..25f3bf9 100644 --- a/src/run.py +++ b/src/run.py @@ -40,6 +40,7 @@ class Bot(commands.Bot): self.api_keys = config.get("api", {}) self.emoji = config.get("emoji", {}) self.misc = config.get("misc", {}) + self.config_mode = config.get("mode") async def setup_hook(self) -> None: # Load cogs @@ -49,8 +50,11 @@ class Bot(commands.Bot): await bot.load_extension(f"cogs.{name}") # Sync slash commands to Discord - self.tree.copy_global_to(guild=discord.Object(id=412646636771344395)) # Temporary. Development purposes only. - await self.tree.sync(guild=discord.Object(id=412646636771344395)) # Temporary. Development purposes only. + if self.config_mode == 'prod': + await self.tree.sync() + else: + self.tree.copy_global_to(guild=discord.Object(id=412646636771344395)) + await self.tree.sync(guild=discord.Object(id=412646636771344395)) # Create bot instance