mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Added scopeless kwarg to discord.utils.oauth_url
This commit is contained in:
parent
d5c80b6cf5
commit
b1b736971a
@ -327,7 +327,7 @@ def oauth_url(
|
|||||||
permissions: Permissions = MISSING,
|
permissions: Permissions = MISSING,
|
||||||
guild: Snowflake = MISSING,
|
guild: Snowflake = MISSING,
|
||||||
redirect_uri: str = MISSING,
|
redirect_uri: str = MISSING,
|
||||||
scopes: Iterable[str] = MISSING,
|
scopes: Optional[Iterable[str]] = MISSING,
|
||||||
disable_guild_select: bool = False,
|
disable_guild_select: bool = False,
|
||||||
state: str = MISSING,
|
state: str = MISSING,
|
||||||
) -> str:
|
) -> str:
|
||||||
@ -369,6 +369,7 @@ def oauth_url(
|
|||||||
The OAuth2 URL for inviting the bot into guilds.
|
The OAuth2 URL for inviting the bot into guilds.
|
||||||
"""
|
"""
|
||||||
url = f'https://discord.com/oauth2/authorize?client_id={client_id}'
|
url = f'https://discord.com/oauth2/authorize?client_id={client_id}'
|
||||||
|
if scopes is not None:
|
||||||
url += '&scope=' + '+'.join(scopes or ('bot', 'applications.commands'))
|
url += '&scope=' + '+'.join(scopes or ('bot', 'applications.commands'))
|
||||||
if permissions is not MISSING:
|
if permissions is not MISSING:
|
||||||
url += f'&permissions={permissions.value}'
|
url += f'&permissions={permissions.value}'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user