diff --git a/music_commands.py b/music_commands.py index a34d25a..1870199 100644 --- a/music_commands.py +++ b/music_commands.py @@ -801,7 +801,7 @@ class MusicModule(commands.Cog): async def setup(bot): 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") await bot.add_cog(MusicModule(bot, "discord")) logger.info("Loading music commands module done") diff --git a/music_functions.py b/music_functions.py index fae2296..628ed31 100644 --- a/music_functions.py +++ b/music_functions.py @@ -29,13 +29,13 @@ class MusicFileList(object): 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.file_service_active = False self.logger = uplogger 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 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( 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: - await self.bot.change_presence( + await bot.change_presence( activity=discord.Game(name="Axe Throwing Darts") )