Add support for audit log reasons.

Most routes now have a 'reason' keyword argument.
This commit is contained in:
Rapptz
2017-05-07 03:08:06 -04:00
parent 2b44876955
commit dff6bcc745
9 changed files with 217 additions and 131 deletions

View File

@ -147,11 +147,16 @@ class Invite(Hashable):
yield from self._state.http.accept_invite(self.code)
@asyncio.coroutine
def delete(self):
def delete(self, *, reason=None):
"""|coro|
Revokes the instant invite.
Parameters
-----------
reason: Optional[str]
The reason for deleting this invite. Shows up on the audit log.
Raises
-------
Forbidden
@ -162,4 +167,4 @@ class Invite(Hashable):
Revoking the invite failed.
"""
yield from self._state.http.delete_invite(self.code)
yield from self._state.http.delete_invite(self.code, reason=reason)