Return invites when deleting them via Invite.delete or Client.delete_invite

This commit is contained in:
owocado
2025-06-21 00:33:29 +05:30
committed by GitHub
parent d00c124883
commit 4862ea22fd
3 changed files with 7 additions and 5 deletions

View File

@ -2550,7 +2550,7 @@ class Client:
)
return Invite.from_incomplete(state=self._connection, data=data)
async def delete_invite(self, invite: Union[Invite, str], /) -> None:
async def delete_invite(self, invite: Union[Invite, str], /) -> Invite:
"""|coro|
Revokes an :class:`.Invite`, URL, or ID to an invite.
@ -2578,7 +2578,8 @@ class Client:
"""
resolved = utils.resolve_invite(invite)
await self.http.delete_invite(resolved.code)
data = await self.http.delete_invite(resolved.code)
return Invite.from_incomplete(state=self._connection, data=data)
# Miscellaneous stuff