mirror of
https://github.com/miaowware/qrm2.git
synced 2024-11-23 00:08:38 -05:00
WIP: answer hamstudy by reaction
This commit is contained in:
parent
776ff72581
commit
b6f6d0408c
@ -44,7 +44,11 @@ emojis = SimpleNamespace(check_mark='✅',
|
|||||||
warning='⚠️',
|
warning='⚠️',
|
||||||
question='❓',
|
question='❓',
|
||||||
no_entry='⛔',
|
no_entry='⛔',
|
||||||
bangbang='‼️')
|
bangbang='‼️',
|
||||||
|
a='🇦',
|
||||||
|
b='🇧',
|
||||||
|
c='🇨',
|
||||||
|
d='🇩')
|
||||||
|
|
||||||
paths = SimpleNamespace(data=Path("./data/"),
|
paths = SimpleNamespace(data=Path("./data/"),
|
||||||
resources=Path("./resources/"),
|
resources=Path("./resources/"),
|
||||||
|
@ -152,16 +152,24 @@ class StudyCog(commands.Cog):
|
|||||||
embed.description = self.source
|
embed.description = self.source
|
||||||
embed.colour = cmn.colours.good
|
embed.colour = cmn.colours.good
|
||||||
embed.add_field(name='Question:', value=question['text'], inline=False)
|
embed.add_field(name='Question:', value=question['text'], inline=False)
|
||||||
embed.add_field(name='Answers:', value='**A:** ' + question['answers']['A']
|
embed.add_field(name='Answers:',
|
||||||
+ '\n**B:** ' + question['answers']['B']
|
value=(f"**{cmn.emojis.a}** {question['answers']['A']}"
|
||||||
+ '\n**C:** ' + question['answers']['C']
|
f"\n**{cmn.emojis.b}** {question['answers']['B']}"
|
||||||
+ '\n**D:** ' + question['answers']['D'], inline=False)
|
f"\n**{cmn.emojis.c}** {question['answers']['C']}"
|
||||||
|
f"\n**{cmn.emojis.d}** {question['answers']['D']}"),
|
||||||
|
inline=False)
|
||||||
embed.add_field(name='Answer:', value='Type _?rqa_ for answer', inline=False)
|
embed.add_field(name='Answer:', value='Type _?rqa_ for answer', inline=False)
|
||||||
if 'image' in question:
|
if 'image' in question:
|
||||||
image_url = f'https://hamstudy.org/_1330011/images/{pool.split("_",1)[1]}/{question["image"]}'
|
image_url = f'https://hamstudy.org/_1330011/images/{pool.split("_",1)[1]}/{question["image"]}'
|
||||||
embed.set_image(url=image_url)
|
embed.set_image(url=image_url)
|
||||||
self.lastq[ctx.message.channel.id] = (question['id'], question['answer'])
|
self.lastq[ctx.message.channel.id] = (question['id'], question['answer'])
|
||||||
await ctx.send(embed=embed)
|
q_msg = await ctx.send(embed=embed)
|
||||||
|
|
||||||
|
await cmn.add_react(q_msg, cmn.emojis.a)
|
||||||
|
await cmn.add_react(q_msg, cmn.emojis.b)
|
||||||
|
await cmn.add_react(q_msg, cmn.emojis.c)
|
||||||
|
await cmn.add_react(q_msg, cmn.emojis.d)
|
||||||
|
|
||||||
|
|
||||||
@commands.command(name="hamstudyanswer", aliases=['rqa', 'randomquestionanswer', 'randomqa', 'hamstudya'], category=cmn.cat.study)
|
@commands.command(name="hamstudyanswer", aliases=['rqa', 'randomquestionanswer', 'randomqa', 'hamstudya'], category=cmn.cat.study)
|
||||||
async def _q_answer(self, ctx: commands.Context, answer: str = None):
|
async def _q_answer(self, ctx: commands.Context, answer: str = None):
|
||||||
|
Loading…
Reference in New Issue
Block a user