Fix purge ctx references

This commit is contained in:
Zeva Rose 2021-06-30 19:46:58 -06:00
parent 30f21c6b85
commit a44f52a1f3

View file

@ -80,7 +80,7 @@ class AdminCog(commands.Cog):
await self._kick(ctx, user, reason) await self._kick(ctx, user, reason)
async def _purge(self, ctx, amount: int = 30): async def _purge(self, ctx, amount: int = 30):
channel = ctx.message.channel channel = ctx.channel
messages = [] messages = []
async for message in channel.history(limit=amount + 1): async for message in channel.history(limit=amount + 1):
messages.append(message) messages.append(message)
@ -88,7 +88,7 @@ class AdminCog(commands.Cog):
self.db.purges.insert_one( self.db.purges.insert_one(
{ {
"channel": ctx.channel.id, "channel": ctx.channel.id,
"guild": ctx.channel.guild.id, "guild": ctx.guild.id,
"admin": ctx.author.id, "admin": ctx.author.id,
"count": amount, "count": amount,
"time": datetime.now(), "time": datetime.now(),