This commit is contained in:
2024-11-14 20:08:31 +01:00
parent b15c2f06b8
commit f4f4deb848
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -801,7 +801,7 @@ class MusicModule(commands.Cog):
async def setup(bot): async def setup(bot):
logger = logging.getLogger("discord") logger = logging.getLogger("discord")
await music_functions.MUSIC_FILE_LIST.refresh_file_list() await music_functions.MUSIC_FILE_LIST.refresh_file_list(bot)
logger.info("Playlist generation") logger.info("Playlist generation")
await bot.add_cog(MusicModule(bot, "discord")) await bot.add_cog(MusicModule(bot, "discord"))
logger.info("Loading music commands module done") logger.info("Loading music commands module done")
+4 -4
View File
@@ -29,13 +29,13 @@ class MusicFileList(object):
file service or local directory and update the list with new items. file service or local directory and update the list with new items.
""" """
def __init__(self, uplogger) -> None: def __init__(self, uplogger,) -> None:
self.music_file_list = [] self.music_file_list = []
self.file_service_active = False self.file_service_active = False
self.logger = uplogger self.logger = uplogger
self.logger.info("Created Playlist organizer class") self.logger.info("Created Playlist organizer class")
async def refresh_file_list(self): async def refresh_file_list(self, bot):
""" """
The `refresh_file_list` function attempts to connect to a file service to retrieve a list of music The `refresh_file_list` function attempts to connect to a file service to retrieve a list of music
files, and if unsuccessful, it populates the list by scanning a local directory for .mp3 files. files, and if unsuccessful, it populates the list by scanning a local directory for .mp3 files.
@@ -70,10 +70,10 @@ class MusicFileList(object):
radio_hardkor = discord.Streaming( radio_hardkor = discord.Streaming(
name="Radio Hardkor", url="http://95.175.16.246:666/mp3-stream" name="Radio Hardkor", url="http://95.175.16.246:666/mp3-stream"
) )
await self.bot.change_presence(status=status, activity=radio_hardkor) await bot.change_presence(status=status, activity=radio_hardkor)
else: else:
await self.bot.change_presence( await bot.change_presence(
activity=discord.Game(name="Axe Throwing Darts") activity=discord.Game(name="Axe Throwing Darts")
) )