Skip to content

Commit

Permalink
Added scopeless kwarg to discord.utils.oauth_url
Browse files Browse the repository at this point in the history
  • Loading branch information
Depreca1ed authored Jan 17, 2025
1 parent d5c80b6 commit b1b7369
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions discord/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def oauth_url(
permissions: Permissions = MISSING,
guild: Snowflake = MISSING,
redirect_uri: str = MISSING,
scopes: Iterable[str] = MISSING,
scopes: Optional[Iterable[str]] = MISSING,
disable_guild_select: bool = False,
state: str = MISSING,
) -> str:
Expand Down Expand Up @@ -369,7 +369,8 @@ def oauth_url(
The OAuth2 URL for inviting the bot into guilds.
"""
url = f'https://discord.com/oauth2/authorize?client_id={client_id}'
url += '&scope=' + '+'.join(scopes or ('bot', 'applications.commands'))
if scopes is not None:
url += '&scope=' + '+'.join(scopes or ('bot', 'applications.commands'))
if permissions is not MISSING:
url += f'&permissions={permissions.value}'
if guild is not MISSING:
Expand Down

0 comments on commit b1b7369

Please sign in to comment.