Skip to content

Commit

Permalink
Readd friend invite creation functionality (fix #575)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Jan 17, 2024
1 parent 29d224e commit 43f46aa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,27 @@ async def fetch_invite(
)
return Invite.from_incomplete(state=self._connection, data=data)

async def create_invite(self) -> Invite:
"""|coro|
Creates a new friend :class:`.Invite`.
.. versionadded:: 2.0
Raises
------
HTTPException
Creating the invite failed.
Returns
--------
:class:`.Invite`
The created friend invite.
"""
state = self._connection
data = await state.http.create_friend_invite()
return Invite.from_incomplete(state=state, data=data)

async def accept_invite(self, url: Union[Invite, str], /) -> Invite:
"""|coro|
Expand Down

0 comments on commit 43f46aa

Please sign in to comment.