Handle inability do delete others' messages (#1111)

This commit is contained in:
Tobotimus 2017-11-23 17:21:53 +11:00 committed by palmtree5
parent 2c96844209
commit 09ed5e67a6

View File

@ -109,5 +109,10 @@ class RedContext(commands.Context):
await query.delete()
break
else:
await self.channel.delete_messages((query, resp))
try:
await self.channel.delete_messages((query, resp))
except discord.HTTPException:
# In case the bot can't delete other users' messages,
# or is not a bot account
await query.delete()
return ret