FEAT: Attemping to still add loop

FIX: Did some REF of the main.py to make more sense.
This commit is contained in:
Dan 2024-08-14 14:05:20 -04:00
parent b18ab58876
commit ae3a610b33
2 changed files with 34 additions and 6 deletions

15
main.py
View File

@ -31,18 +31,21 @@ class Selena(discord.Client):
def load_modules(self): def load_modules(self):
if config['modules']['music']['enabled']: if config['modules']['music']['enabled']:
from modules.music.music import setup as music_setup from modules.music.music import Music
music_setup(self) music = Music(self)
music.setup(self.tree)
logging.info("Music module loaded") logging.info("Music module loaded")
if config['modules']['terms_privacy']['enabled']: if config['modules']['terms_privacy']['enabled']:
from modules.admin.terms_privacy import setup as terms_privacy_setup from modules.admin.terms_privacy import TermsPrivacy
terms_privacy_setup(self) terms_privacy = TermsPrivacy(self)
terms_privacy.setup(self.tree)
logging.info("Terms and Privacy module loaded") logging.info("Terms and Privacy module loaded")
if config['modules']['data_privacy']['enabled']: if config['modules']['data_privacy']['enabled']:
from modules.admin.data_privacy import setup as data_privacy_setup from modules.admin.data_privacy import DataPrivacy
data_privacy_setup(self) data_privacy = DataPrivacy(self)
data_privacy.setup(self.tree)
logging.info("Data Privacy module loaded") logging.info("Data Privacy module loaded")

View File

@ -19,6 +19,7 @@ FFMPEG_OPTIONS = {
ytdl = YoutubeDL(YTDL_OPTIONS) ytdl = YoutubeDL(YTDL_OPTIONS)
class Music(commands.Cog): class Music(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@ -152,6 +153,30 @@ class Music(commands.Cog):
await interaction.response.defer() await interaction.response.defer()
await self.toggle_loop(interaction) 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): def setup(bot):
music = Music(bot) music = Music(bot)