@@ -2830,6 +2830,66 @@ async def get_full_audit_logs(
28302830
28312831 return AuditLogs (** _audit_log_dict )
28322832
2833+ async def get_invite (
2834+ self ,
2835+ invite_code : str ,
2836+ with_counts : Optional [bool ] = MISSING ,
2837+ with_expiration : Optional [bool ] = MISSING ,
2838+ guild_scheduled_event_id : Optional [int ] = MISSING ,
2839+ ) -> "Invite" :
2840+ """
2841+ Gets the invite using its code.
2842+
2843+ :param str invite_code: A string representing the invite code.
2844+ :param Optional[bool] with_counts: Whether approximate_member_count and approximate_presence_count are returned.
2845+ :param Optional[bool] with_expiration: Whether the invite's expiration date is returned.
2846+ :param Optional[int] guild_scheduled_event_id: A guild scheduled event's ID.
2847+ :return: An invite
2848+ :rtype: Invite
2849+ """
2850+ if not self ._client :
2851+ raise LibraryException (code = 13 )
2852+
2853+ _with_counts = with_counts if with_counts is not MISSING else None
2854+ _with_expiration = with_expiration if with_expiration is not MISSING else None
2855+ _guild_scheduled_event_id = (
2856+ guild_scheduled_event_id if guild_scheduled_event_id is not MISSING else None
2857+ )
2858+
2859+ res = await self ._client .get_invite (
2860+ invite_code = invite_code ,
2861+ with_counts = _with_counts ,
2862+ with_expiration = _with_expiration ,
2863+ guild_scheduled_event_id = _guild_scheduled_event_id ,
2864+ )
2865+
2866+ return Invite (** res , _client = self ._client )
2867+
2868+ async def delete_invite (self , invite_code : str , reason : Optional [str ] = None ) -> None :
2869+ """
2870+ Deletes the invite using its code.
2871+
2872+ :param str invite_code: A string representing the invite code.
2873+ :param Optional[str] reason: The reason of the deletion
2874+ """
2875+ if not self ._client :
2876+ raise LibraryException (code = 13 )
2877+
2878+ await self ._client .delete_invite (invite_code = invite_code , reason = reason )
2879+
2880+ async def get_invites (self ) -> List ["Invite" ]:
2881+ """
2882+ Gets invites of the guild.
2883+
2884+ :return: A list of guild invites
2885+ :rtype: List[Invite]
2886+ """
2887+ if not self ._client :
2888+ raise LibraryException (code = 13 )
2889+
2890+ res = await self ._client .get_guild_invites (guild_id = int (self .id ))
2891+ return [Invite (** _ , _client = self ._client ) for _ in res ]
2892+
28332893 @property
28342894 def icon_url (self ) -> Optional [str ]:
28352895 """
0 commit comments