Skip to content

Commit 43f46aa

Browse files
committed
Readd friend invite creation functionality (fix #575)
1 parent 29d224e commit 43f46aa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

discord/client.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,27 @@ async def fetch_invite(
20952095
)
20962096
return Invite.from_incomplete(state=self._connection, data=data)
20972097

2098+
async def create_invite(self) -> Invite:
2099+
"""|coro|
2100+
2101+
Creates a new friend :class:`.Invite`.
2102+
2103+
.. versionadded:: 2.0
2104+
2105+
Raises
2106+
------
2107+
HTTPException
2108+
Creating the invite failed.
2109+
2110+
Returns
2111+
--------
2112+
:class:`.Invite`
2113+
The created friend invite.
2114+
"""
2115+
state = self._connection
2116+
data = await state.http.create_friend_invite()
2117+
return Invite.from_incomplete(state=state, data=data)
2118+
20982119
async def accept_invite(self, url: Union[Invite, str], /) -> Invite:
20992120
"""|coro|
21002121

0 commit comments

Comments
 (0)