diff --git a/extendedaudio/extendedaudio.py b/extendedaudio/extendedaudio.py index cf13d15..8f3942a 100644 --- a/extendedaudio/extendedaudio.py +++ b/extendedaudio/extendedaudio.py @@ -36,7 +36,11 @@ class ExtendedAudio(commands.Cog): "last_status_message": None, # ID of the last status message (for cleanup) "clean_old_messages": True, # Whether to delete old status messages } + default_global = { + "disable_notify_command": True, # Whether to disable the audioset notify command + } self.config.register_guild(**default_guild) + self.config.register_global(**default_global) self.task = self.bot.loop.create_task(self.initialize()) self.audio = None @@ -376,11 +380,30 @@ class ExtendedAudio(commands.Cog): except Exception as e: log.error(f"Error resetting channel name on stop: {e}") + @commands.command() + @commands.is_owner() + async def togglenotify(self, ctx: commands.Context): + """Toggle whether the audioset notify command should be disabled. + + This command is bot owner only. + When disabled, users will be directed to use ExtendedAudio's notification features instead. + """ + current = await self.config.disable_notify_command() + await self.config.disable_notify_command.set(not current) + state = "disabled" if not current else "enabled" + await ctx.send(f"The audioset notify command is now {state}.") + async def cog_before_invoke(self, ctx: commands.Context): """Check if the voice channel can be used before any audio command.""" if not ctx.guild: return True + # Check if we should block audioset notify + if await self.config.disable_notify_command(): + if ctx.command.qualified_name == "audioset notify": + await ctx.send("This command is disabled. Please use the ExtendedAudio cog's notification features instead.") + return False + # Only check audio-related commands if not self.audio or ctx.cog != self.audio: return True