diff options
| author | Rapptz <[email protected]> | 2017-05-07 03:08:06 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-05-07 03:08:06 -0400 |
| commit | dff6bcc7457febf7bb1d797bd777e728f623e938 (patch) | |
| tree | 2d2aa0ff68f5954b8733babf7aee6df6eaab151b /discord/invite.py | |
| parent | Fix NameError when making things Object in audit logs. (diff) | |
| download | discord.py-dff6bcc7457febf7bb1d797bd777e728f623e938.tar.xz discord.py-dff6bcc7457febf7bb1d797bd777e728f623e938.zip | |
Add support for audit log reasons.
Most routes now have a 'reason' keyword argument.
Diffstat (limited to 'discord/invite.py')
| -rw-r--r-- | discord/invite.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/discord/invite.py b/discord/invite.py index 17e3aecd..44aa90f6 100644 --- a/discord/invite.py +++ b/discord/invite.py @@ -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) |