Skip to content

Commit

Permalink
Added check for deleting error message responses
Browse files Browse the repository at this point in the history
  • Loading branch information
imayhaveborkedit committed May 20, 2016
1 parent 9238f3f commit 43c49a1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion musicbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,16 @@ async def on_message(self, message):

except (exceptions.CommandError, exceptions.HelpfulError, exceptions.ExtractionError) as e:
print("{0.__class__}: {0.message}".format(e))
await self.safe_send_message(message.channel, '```\n%s\n```' % e.message, expire_in=e.expire_in)

expirein = e.expire_in if self.config.delete_messages else None
alsodelete = message if self.config.delete_invoking else None

await self.safe_send_message(
message.channel,
'```\n%s\n```' % e.message,
expire_in=expirein,
also_delete=alsodelete
)

except exceptions.Signal:
raise
Expand Down

0 comments on commit 43c49a1

Please sign in to comment.