@@ -2234,8 +2234,8 @@ async def fetch_invite(
22342234 url : Union [Invite , str ],
22352235 * ,
22362236 with_counts : bool = True ,
2237- with_expiration : bool = True ,
22382237 guild_scheduled_event_id : Optional [int ] = None ,
2238+ with_expiration : bool = False ,
22392239 ) -> Invite :
22402240 """|coro|
22412241
@@ -2255,12 +2255,6 @@ async def fetch_invite(
22552255 Whether to include count information in the invite. This fills the
22562256 :attr:`.Invite.approximate_member_count` and :attr:`.Invite.approximate_presence_count`
22572257 fields.
2258- with_expiration: :class:`bool`
2259- Whether to include the expiration date of the invite. This fills the
2260- :attr:`.Invite.expires_at` field.
2261-
2262- .. versionadded:: 2.0
2263-
22642258 guild_scheduled_event_id: :class:`int`
22652259 The ID of the scheduled event to include in the invite.
22662260 If not provided, defaults to the ``event`` parameter in the URL if it exists,
@@ -2280,6 +2274,14 @@ async def fetch_invite(
22802274 :class:`.Invite`
22812275 The invite from the URL/ID.
22822276 """
2277+ if with_expiration :
2278+ utils .warn_deprecated (
2279+ "Using the `with_expiration` argument is deprecated and will "
2280+ "result in an error in future versions. "
2281+ "The `expires_at` field is always included now." ,
2282+ stacklevel = 2 ,
2283+ )
2284+
22832285 invite_id , params = utils .resolve_invite (url , with_params = True )
22842286
22852287 if not guild_scheduled_event_id :
@@ -2292,7 +2294,6 @@ async def fetch_invite(
22922294 data = await self .http .get_invite (
22932295 invite_id ,
22942296 with_counts = with_counts ,
2295- with_expiration = with_expiration ,
22962297 guild_scheduled_event_id = guild_scheduled_event_id ,
22972298 )
22982299 return Invite .from_incomplete (state = self ._connection , data = data )
0 commit comments