diff --git a/src/cogs/music.py b/src/cogs/music.py index 0101138..e7e559a 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -44,7 +44,6 @@ genius.response_format = "markdown" def setup(client): client.add_cog(Music(client)) - # URL matching REGEX... URL_REG = re.compile(r'https?://(?:www\.)?.+') @@ -376,6 +375,11 @@ class Music(commands.Cog, wavelink.WavelinkMixin): sleep(1) # Port is open -> no service behind, retrying in 1 second... if timeout <= 0: + fileName = __file__.split("\\") # split for windows + if len(fileName) == 1: # if it wasn't windows + fileName = fileName[0].split("/") # split for linux + fileName = fileName[-1][:-3] # get file name and remove extension + self.bot.unload_extension(f"{self.bot.cogs_folder}.{fileName}") raise TimeoutError @wavelink.WavelinkMixin.listener()