Chatchart, async msg delete -> rewrite msg delete

This commit is contained in:
aikaterna
2018-05-13 10:51:45 -07:00
parent 519d46dfaa
commit 9d03695362

View File

@@ -59,13 +59,13 @@ class Chatchart:
channel = ctx.message.channel
history = []
if not channel.permissions_for(ctx.message.author).read_messages == True:
await self.bot.delete_message(em)
await em.delete()
return await ctx.send("You're not allowed to access that channel.")
try:
async for msg in channel.history(limit=messages):
history.append(msg)
except discord.errors.Forbidden:
await self.bot.delete_message(em)
await em.delete()
return await ctx.send("No permissions to read that channel.")
msg_data = {'total count': 0, 'users': {}}