def oauth_url(client_id: Union[(int, str)], *, permissions: Permissions=MISSING, guild: Snowflake=MISSING, redirect_uri: str=MISSING, scopes: Iterable[str]=MISSING, disable_guild_select: bool=False) -> str:
    "A helper function that returns the OAuth2 URL for inviting the bot\n    into guilds.\n\n    Parameters\n    -----------\n    client_id: Union[:class:`int`, :class:`str`]\n        The client ID for your bot.\n    permissions: :class:`~discord.Permissions`\n        The permissions you're requesting. If not given then you won't be requesting any\n        permissions.\n    guild: :class:`~discord.abc.Snowflake`\n        The guild to pre-select in the authorization screen, if available.\n    redirect_uri: :class:`str`\n        An optional valid redirect URI.\n    scopes: Iterable[:class:`str`]\n        An optional valid list of scopes. Defaults to ``('bot',)``.\n\n        .. versionadded:: 1.7\n    disable_guild_select: :class:`bool`\n        Whether to disallow the user from changing the guild dropdown.\n\n        .. versionadded:: 2.0\n\n    Returns\n    --------\n    :class:`str`\n        The OAuth2 URL for inviting the bot into guilds.\n    "
    url = f'https://discord.com/oauth2/authorize?client_id={client_id}'
    url += ('&scope=' + '+'.join((scopes or ('bot',))))
    if (permissions is not MISSING):
        url += f'&permissions={permissions.value}'
    if (guild is not MISSING):
        url += f'&guild_id={guild.id}'
    if (redirect_uri is not MISSING):
        from urllib.parse import urlencode
        url += ('&response_type=code&' + urlencode({'redirect_uri': redirect_uri}))
    if disable_guild_select:
        url += '&disable_guild_select=true'
    return url
A helper function that returns the OAuth2 URL for inviting the bot
into guilds.

Parameters
-----------
client_id: Union[:class:`int`, :class:`str`]
    The client ID for your bot.
permissions: :class:`~discord.Permissions`
    The permissions you're requesting. If not given then you won't be requesting any
    permissions.
guild: :class:`~discord.abc.Snowflake`
    The guild to pre-select in the authorization screen, if available.
redirect_uri: :class:`str`
    An optional valid redirect URI.
scopes: Iterable[:class:`str`]
    An optional valid list of scopes. Defaults to ``('bot',)``.

    .. versionadded:: 1.7
disable_guild_select: :class:`bool`
    Whether to disallow the user from changing the guild dropdown.

    .. versionadded:: 2.0

Returns
--------
:class:`str`
    The OAuth2 URL for inviting the bot into guilds.
def oauth_url(client_id: Union[(int, str)], *, permissions: Permissions=MISSING, guild: Snowflake=MISSING, redirect_uri: str=MISSING, scopes: Iterable[str]=MISSING, disable_guild_select: bool=False) -> str:
    "A helper function that returns the OAuth2 URL for inviting the bot\n    into guilds.\n\n    Parameters\n    -----------\n    client_id: Union[:class:`int`, :class:`str`]\n        The client ID for your bot.\n    permissions: :class:`~discord.Permissions`\n        The permissions you're requesting. If not given then you won't be requesting any\n        permissions.\n    guild: :class:`~discord.abc.Snowflake`\n        The guild to pre-select in the authorization screen, if available.\n    redirect_uri: :class:`str`\n        An optional valid redirect URI.\n    scopes: Iterable[:class:`str`]\n        An optional valid list of scopes. Defaults to ``('bot',)``.\n\n        .. versionadded:: 1.7\n    disable_guild_select: :class:`bool`\n        Whether to disallow the user from changing the guild dropdown.\n\n        .. versionadded:: 2.0\n\n    Returns\n    --------\n    :class:`str`\n        The OAuth2 URL for inviting the bot into guilds.\n    "
    url = f'https://discord.com/oauth2/authorize?client_id={client_id}'
    url += ('&scope=' + '+'.join((scopes or ('bot',))))
    if (permissions is not MISSING):
        url += f'&permissions={permissions.value}'
    if (guild is not MISSING):
        url += f'&guild_id={guild.id}'
    if (redirect_uri is not MISSING):
        from urllib.parse import urlencode
        url += ('&response_type=code&' + urlencode({'redirect_uri': redirect_uri}))
    if disable_guild_select:
        url += '&disable_guild_select=true'
    return url