From f3833e94adb8104b06a8d944671c6e935f8f41aa Mon Sep 17 00:00:00 2001 From: Twentysix Date: Thu, 18 Aug 2016 13:47:30 +0200 Subject: [PATCH] Added source_address in Audio, fixed typo in Trivia source_address should fix the "Too many requests" issue with certain hosts --- cogs/audio.py | 3 ++- cogs/trivia.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cogs/audio.py b/cogs/audio.py index 9dd9be368..08a7e29d0 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -36,6 +36,7 @@ else: opus = True youtube_dl_options = { + 'source_address': '0.0.0.0', 'format': 'bestaudio/best', 'extractaudio': True, 'audioformat': "mp3", @@ -463,7 +464,7 @@ class Audio: # TODO: _enable_controls() - # returns list of active voice channels + # returns list of active voice channels # assuming list does not change during the execution of this function # if that happens, blame asyncio. def _get_active_voice_clients(self): diff --git a/cogs/trivia.py b/cogs/trivia.py index bc18998a0..72a0956f4 100644 --- a/cogs/trivia.py +++ b/cogs/trivia.py @@ -166,7 +166,7 @@ class TriviaSession(): if parsed_list != []: return parsed_list else: - self.stop_trivia() + await self.stop_trivia() return None async def new_question(self): @@ -217,7 +217,7 @@ class TriviaSession(): await asyncio.sleep(3) if not self.status == "stop": await self.new_question() - + async def send_table(self): self.score_list = sorted(self.score_list.items(), reverse=True, key=lambda x: x[1]) # orders score from lower to higher t = "```Scores: \n\n"