aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar Hedy Li <[email protected]>2020-10-15 07:58:19 +0800
committerGravatar GitHub <[email protected]>2020-10-15 07:58:19 +0800
commitbe75e6c4d1d65b9b5710ec5fe08bf519a1cdda14 (patch)
tree170308e79dc157ebcb02566508fa87d98008d4dc /bot
parentremove duplicates in winner list .riddle (diff)
update self.winners methods for a set()
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/easter/easter_riddle.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/exts/easter/easter_riddle.py b/bot/exts/easter/easter_riddle.py
index 513215d1..3c612eb1 100644
--- a/bot/exts/easter/easter_riddle.py
+++ b/bot/exts/easter/easter_riddle.py
@@ -22,7 +22,7 @@ class EasterRiddle(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
- self.winners = []
+ self.winners = set()
self.correct = ""
self.current_channel = None
@@ -67,7 +67,7 @@ class EasterRiddle(commands.Cog):
await asyncio.sleep(TIMELIMIT)
if self.winners:
- win_list = " ".join(set(self.winners)) # remove duplicated users if any
+ win_list = " ".join(self.winners)
content = f"Well done {win_list} for getting it right!"
else:
content = "Nobody got it right..."
@@ -79,7 +79,7 @@ class EasterRiddle(commands.Cog):
await ctx.send(content, embed=answer_embed)
- self.winners = []
+ self.winners.clear()
self.current_channel = None
@commands.Cog.listener()
@@ -92,7 +92,7 @@ class EasterRiddle(commands.Cog):
return
if message.content.lower() == self.correct.lower():
- self.winners.append(message.author.mention)
+ self.winners.add(message.author.mention)
def setup(bot: commands.Bot) -> None: