Better unloading of background tasks

This commit is contained in:
Twentysix 2016-03-29 15:41:46 +02:00
parent cab5b23b0b
commit 4be9757404
2 changed files with 2 additions and 2 deletions

View File

@ -590,7 +590,7 @@ class Audio:
return False
async def queue_manager(self):
while "Audio" in self.bot.cogs:
while self == self.bot.get_cog("Audio"):
if not self.music_player.paused:
if self.queue and not self.music_player.is_playing():
new_link = self.queue[0]

View File

@ -280,7 +280,7 @@ class Streams:
async def stream_checker(self):
CHECK_DELAY = 60
while "Streams" in self.bot.cogs:
while self == self.bot.get_cog("Streams"):
old = (deepcopy(self.twitch_streams), deepcopy(self.hitbox_streams), deepcopy(self.beam_streams))