[V3 Context] Fix ctx.send_interactive in DM (#1221)

Fixes #1220
This commit is contained in:
Tobotimus 2017-12-31 11:29:07 +11:00 committed by GitHub
parent c737785114
commit 80d68684fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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