DiscordApplication.GenerateBotOAuth does not account for all OAuth scopes
See original GitHub issueSummary
Using the DiscordApplication.GenerateBotOAuth()
method does not allow selecting all scopes to generate an OAuth URI.
It currently only supports the bot
scope, and doesn’t support redirect URIs.
Details
Starting from an ideal result of
https://discord.com/api/oauth2/authorize?client_id=583412458560159776&permissions=8&scope=bot applications.commands
This link has scopes bot
and applications.commands
and permission 0x8
(Administrator) specified.
(Generated from Discord’s OAuth URL Generator tool, using the following settings)
However, the current method only allows specifying a DSharpPlus.Permissions
argument, inferring that the OAuth link will only use the bot
scope.
Ideally, we should be able to specify further parameters, like OAuth scopes, and a redirect link, used by other scopes (only bot
and applications.commands
don’t make use of a redirect).
An ideal implementation would be an overload, or extending the current method, as such:
public string GenerateBotOAuth(
Permissions permissions = Permissions.None,
OAuthScopes scopes = OAuthScopes.Bot,
string RedirectUri = null)
{ /* Implementation */ }
// TODO: Add OAuthScopes enum.
Instead of the current method, found here (source) :
public string GenerateBotOAuth(Permissions permissions = Permissions.None) { /* Implementation */ }
Let it also be known that the current method spars absolutely no documentation whatsoever, so we might want to brush up on that too ^^
Steps to reproduce
N/A
Notes
If maintainers have their hands full, I’d be happy to Fork & PR relevant changes, as well as add documentation to the method, given my first-hand interest in this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
Just saw the follow-up this morning. I wanted to apologise for bringing this up in the first place, and apologise to you people, especially @VelvetThePanda, as a maintainer. Indeed, this should not’ve been brought up. Not wanting to reiterate such a mistake, I’m ready to renew my support by bringing solid contributions to DSharpPlus, wherever I can.
To conclude, thank you lads/lasses for such a quick conclusion to this issue 😃
Thank you for your apology, I look forward to working with you in the future (if desired)