actual starting

pull/23/head
bobloy 6 years ago
parent ed94b7e1cd
commit 20e2d6026f

@ -38,7 +38,10 @@ class AudioSession(TriviaSession):
await self.ctx.send(msg) await self.ctx.send(msg)
print(question) print(question)
await self.audio.play(ctx=self.ctx, query=question) # await self.ctx.invoke(self.audio.play(ctx=self.ctx, query=question))
await self.ctx.invoke(self.audio.play, query=question)
print("after audio.play")
continue_ = await self.wait_for_answer(answers, delay, timeout) continue_ = await self.wait_for_answer(answers, delay, timeout)
if continue_ is False: if continue_ is False:
@ -49,3 +52,7 @@ class AudioSession(TriviaSession):
else: else:
await self.ctx.send("There are no more questions!") await self.ctx.send("There are no more questions!")
await self.end_game() await self.end_game()
async def end_game(self):
await super().end_game()
await self.ctx.invoke(self.audio.disconnect)

@ -2,6 +2,7 @@ import pathlib
from typing import List from typing import List
import yaml import yaml
from redbot.cogs.audio import Audio
from redbot.cogs.trivia import LOG from redbot.cogs.trivia import LOG
from redbot.cogs.trivia.trivia import InvalidListError, Trivia from redbot.cogs.trivia.trivia import InvalidListError, Trivia
from redbot.core import commands from redbot.core import commands
@ -23,6 +24,13 @@ class AudioTrivia(Trivia):
self.bot = bot self.bot = bot
self.audio = None self.audio = None
# @commands.command()
# @commands.is_owner()
# async def testit(self, ctx: commands.Context):
# self.audio: Audio = self.bot.get_cog("Audio")
# await ctx.invoke(self.audio.play, query="https://www.youtube.com/watch?v=FrceWR4XnVU")
# print("done")
@commands.group(invoke_without_command=True) @commands.group(invoke_without_command=True)
@commands.guild_only() @commands.guild_only()
async def audiotrivia(self, ctx: commands.Context, *categories: str): async def audiotrivia(self, ctx: commands.Context, *categories: str):

Loading…
Cancel
Save