diff options
author | 2018-11-20 13:35:45 +0100 | |
---|---|---|
committer | 2018-11-20 13:35:45 +0100 | |
commit | f11c7cf7e4b0d0dc8e6f7dabb835795588e9eecb (patch) | |
tree | e6bacfbf899ee25062e0972c70f03f40d0254c17 /bot/cogs/hacktober/candy_collection.py | |
parent | Cleaning up bats a bit (diff) |
flake8
Diffstat (limited to 'bot/cogs/hacktober/candy_collection.py')
-rw-r--r-- | bot/cogs/hacktober/candy_collection.py | 13 |
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 |