Added source_address in Audio, fixed typo in Trivia

source_address should fix the "Too many requests" issue with certain hosts
This commit is contained in:
Twentysix 2016-08-18 13:47:30 +02:00
parent 56da31527e
commit f3833e94ad
2 changed files with 4 additions and 3 deletions

View File

@ -36,6 +36,7 @@ else:
opus = True opus = True
youtube_dl_options = { youtube_dl_options = {
'source_address': '0.0.0.0',
'format': 'bestaudio/best', 'format': 'bestaudio/best',
'extractaudio': True, 'extractaudio': True,
'audioformat': "mp3", 'audioformat': "mp3",
@ -463,7 +464,7 @@ class Audio:
# TODO: _enable_controls() # 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 # assuming list does not change during the execution of this function
# if that happens, blame asyncio. # if that happens, blame asyncio.
def _get_active_voice_clients(self): def _get_active_voice_clients(self):

View File

@ -166,7 +166,7 @@ class TriviaSession():
if parsed_list != []: if parsed_list != []:
return parsed_list return parsed_list
else: else:
self.stop_trivia() await self.stop_trivia()
return None return None
async def new_question(self): async def new_question(self):
@ -217,7 +217,7 @@ class TriviaSession():
await asyncio.sleep(3) await asyncio.sleep(3)
if not self.status == "stop": if not self.status == "stop":
await self.new_question() await self.new_question()
async def send_table(self): 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 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" t = "```Scores: \n\n"