From d3fd36fb75d1f38113523e65573fa491b880d141 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 23 Dec 2019 09:53:49 -0500 Subject: [PATCH 1/2] change `embed = embed.add_field()` to `embed.add_field()`. Fixes #106. --- exts/base.py | 8 ++++---- exts/study.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exts/base.py b/exts/base.py index 6d086cb..b629bba 100644 --- a/exts/base.py +++ b/exts/base.py @@ -99,10 +99,10 @@ class BaseCog(commands.Cog): embed.title = "About qrm" embed.description = info.description - embed = embed.add_field(name="Authors", value=", ".join(info.authors)) - embed = embed.add_field(name="License", value=info.license) - embed = embed.add_field(name="Version", value=f'v{info.release}') - embed = embed.add_field(name="Contributing", value=info.contributing, inline=False) + embed.add_field(name="Authors", value=", ".join(info.authors)) + embed.add_field(name="License", value=info.license) + embed.add_field(name="Version", value=f'v{info.release}') + embed.add_field(name="Contributing", value=info.contributing, inline=False) embed.set_thumbnail(url=str(self.bot.user.avatar_url)) await ctx.send(embed=embed) diff --git a/exts/study.py b/exts/study.py index 541bf73..124d53d 100644 --- a/exts/study.py +++ b/exts/study.py @@ -69,16 +69,16 @@ class StudyCog(commands.Cog): embed.title = question['id'] embed.description = self.source embed.colour = cmn.colours.good - embed = embed.add_field(name='Question:', value=question['text'], inline=False) - embed = embed.add_field(name='Answers:', value='**A:** ' + question['answers']['A'] + + embed.add_field(name='Question:', value=question['text'], inline=False) + embed.add_field(name='Answers:', value='**A:** ' + question['answers']['A'] + '\n**B:** ' + question['answers']['B'] + '\n**C:** ' + question['answers']['C'] + '\n**D:** ' + question['answers']['D'], inline=False) - embed = 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: image_url = f'https://hamstudy.org/_1330011/images/{selected_pool.split("_",1)[1]}/{question["image"]}' - embed = embed.set_image(url=image_url) + embed.set_image(url=image_url) self.lastq[ctx.message.channel.id] = (question['id'], question['answer']) await ctx.send(embed=embed) From a93f6d7a035c1e7af9394f6126f169d9d6b83fb0 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 23 Dec 2019 09:57:05 -0500 Subject: [PATCH 2/2] >:-( PEP8 --- exts/study.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exts/study.py b/exts/study.py index 124d53d..806089d 100644 --- a/exts/study.py +++ b/exts/study.py @@ -71,10 +71,10 @@ class StudyCog(commands.Cog): embed.colour = cmn.colours.good embed.add_field(name='Question:', value=question['text'], inline=False) embed.add_field(name='Answers:', value='**A:** ' + question['answers']['A'] + - '\n**B:** ' + question['answers']['B'] + - '\n**C:** ' + question['answers']['C'] + - '\n**D:** ' + question['answers']['D'], - inline=False) + '\n**B:** ' + question['answers']['B'] + + '\n**C:** ' + question['answers']['C'] + + '\n**D:** ' + question['answers']['D'], + inline=False) embed.add_field(name='Answer:', value='Type _?rqa_ for answer', inline=False) if 'image' in question: image_url = f'https://hamstudy.org/_1330011/images/{selected_pool.split("_",1)[1]}/{question["image"]}'