diff --git a/main.py b/main.py index 54e9245..521fec5 100644 --- a/main.py +++ b/main.py @@ -31,18 +31,21 @@ class Selena(discord.Client): def load_modules(self): if config['modules']['music']['enabled']: - from modules.music.music import setup as music_setup - music_setup(self) + from modules.music.music import Music + music = Music(self) + music.setup(self.tree) logging.info("Music module loaded") if config['modules']['terms_privacy']['enabled']: - from modules.admin.terms_privacy import setup as terms_privacy_setup - terms_privacy_setup(self) + from modules.admin.terms_privacy import TermsPrivacy + terms_privacy = TermsPrivacy(self) + terms_privacy.setup(self.tree) logging.info("Terms and Privacy module loaded") if config['modules']['data_privacy']['enabled']: - from modules.admin.data_privacy import setup as data_privacy_setup - data_privacy_setup(self) + from modules.admin.data_privacy import DataPrivacy + data_privacy = DataPrivacy(self) + data_privacy.setup(self.tree) logging.info("Data Privacy module loaded") diff --git a/modules/music/music.py b/modules/music/music.py index fe29351..e16104d 100644 --- a/modules/music/music.py +++ b/modules/music/music.py @@ -19,6 +19,7 @@ FFMPEG_OPTIONS = { ytdl = YoutubeDL(YTDL_OPTIONS) + class Music(commands.Cog): def __init__(self, bot): self.bot = bot @@ -152,6 +153,30 @@ class Music(commands.Cog): await interaction.response.defer() await self.toggle_loop(interaction) + if not tree.get_command("play"): + tree.add_command(play_command) + + if not tree.get_command("pause"): + tree.add_command(pause_command) + + if not tree.get_command("resume"): + tree.add_command(resume_command) + + if not tree.get_command("stop"): + tree.add_command(stop_command) + + if not tree.get_command("volume"): + tree.add_command(volume_command) + + if not tree.get_command("loop"): + tree.add_command(loop_command) + + if not tree.get_command("join"): + tree.add_command(join_command) + + if not tree.get_command("leave"): + tree.add_command(leave_command) + def setup(bot): music = Music(bot)