aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/hacktober/candy_collection.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/cogs/hacktober/candy_collection.py')
-rw-r--r--bot/cogs/hacktober/candy_collection.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/cogs/hacktober/candy_collection.py b/bot/cogs/hacktober/candy_collection.py
index 508793a2..f5f17abb 100644
--- a/bot/cogs/hacktober/candy_collection.py
+++ b/bot/cogs/hacktober/candy_collection.py
@@ -1,9 +1,10 @@
-import discord
-from discord.ext import commands
-import random
-import json
import functools
+import json
import os
+import random
+
+import discord
+from discord.ext import commands
from bot.constants import HACKTOBER_CHANNEL_ID
@@ -126,7 +127,7 @@ class CandyCollection:
for i in range(9):
o = discord.Object(id=recent_msg.id + i)
- msg = await channel.history(limit=1, before=o).next()
+ msg = await next(channel.history(limit=1, before=o))
ten_recent.append(msg.id)
return ten_recent
@@ -140,7 +141,7 @@ class CandyCollection:
o = discord.Object(id=msg_id + 1)
# Use history rather than get_message due to
# poor ratelimit (50/1s vs 1/1s)
- msg = await self.hacktober_channel.history(limit=1, before=o).next()
+ msg = await next(self.hacktober_channel.history(limit=1, before=o))
if msg.id != msg_id:
return None