channel.messages: simplify delete_message's check

This commit is contained in:
Luna Mendes 2018-11-21 21:01:56 -03:00
parent dd3dbf5ace
commit 4580aed97c
1 changed files with 2 additions and 1 deletions

View File

@ -314,7 +314,8 @@ async def delete_message(channel_id, message_id):
by_ownership = author_id == user_id by_ownership = author_id == user_id
if not by_perm and not by_ownership: can_delete = by_perm or by_ownership
if not can_delete:
raise Forbidden('You can not delete this message') raise Forbidden('You can not delete this message')
await app.db.execute(""" await app.db.execute("""