From 9e22147e61b61d8ed489df970fe08440424337d9 Mon Sep 17 00:00:00 2001 From: "S. Co1" Date: Fri, 6 Sep 2019 15:11:42 -0400 Subject: Fix bug in Candy Collection Cog When the ten_recent_msg helper coro is called, it grabs the most recent message by ID, but some of the following lines assume this object is a Message ID, not an integer. --- bot/seasons/halloween/candy_collection.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bot') diff --git a/bot/seasons/halloween/candy_collection.py b/bot/seasons/halloween/candy_collection.py index d35cbee5..a7232e0d 100644 --- a/bot/seasons/halloween/candy_collection.py +++ b/bot/seasons/halloween/candy_collection.py @@ -121,15 +121,16 @@ class CandyCollection(commands.Cog): async def ten_recent_msg(self): """Get the last 10 messages sent in the channel.""" ten_recent = [] - recent_msg = max(message.id for message - in self.bot._connection._messages - if message.channel.id == Channels.seasonalbot_chat) + recent_msg_id = max( + message.id for message in self.bot._connection._messages + if message.channel.id == Channels.seasonalbot_chat + ) channel = await self.hacktober_channel() - ten_recent.append(recent_msg.id) + ten_recent.append(recent_msg_id) for i in range(9): - o = discord.Object(id=recent_msg.id + i) + o = discord.Object(id=recent_msg_id + i) msg = await next(channel.history(limit=1, before=o)) ten_recent.append(msg.id) -- cgit v1.2.3