async def fetch_invite(self, url, *, with_counts=True):
invite_id = utils.resolve_invite(url)<EOL>data = await self.http.get_invite(invite_id, with_counts=with_counts)<EOL>return Invite.from_incomplete(state=self._connection, data=data)<EOL>
|coro|

        Gets an :class:`.Invite` from a discord.gg URL or ID.

        .. note::

            If the invite is for a guild you have not joined, the guild and channel
            attributes of the returned :class:`.Invite` will be :class:`.PartialInviteGuild` and
            :class:`PartialInviteChannel` respectively.

        Parameters
        -----------
        url: :class:`str`
            The discord invite ID or URL (must be a discord.gg URL).
        with_counts: :class:`bool`
            Whether to include count information in the invite. This fills the
            :attr:`.Invite.approximate_member_count` and :attr:`.Invite.approximate_presence_count`
            fields.

        Raises
        -------
        NotFound
            The invite has expired or is invalid.
        HTTPException
            Getting the invite failed.

        Returns
        --------
        :class:`.Invite`
            The invite from the URL/ID.