refactor(oauth): Refine authentication success messages

Update various success messages and help text related to OAuth. Instead
of broadly stating the bot gains general API access, the language now
specifies that it gains access to "scopes" or "additional OAuth scopes"
as allowed during the authentication flow, providing a more precise
understanding of the permissions granted.
This commit is contained in:
Slipstreamm 2025-06-14 12:37:55 -06:00
parent 15f8c91baf
commit d64da1aa9a
3 changed files with 7 additions and 10 deletions

View File

@ -1183,7 +1183,6 @@ async def auth(
<p>You have successfully authenticated with Discord.</p> <p>You have successfully authenticated with Discord.</p>
<div class="info"> <div class="info">
<p>You can now close this window and return to Discord.</p> <p>You can now close this window and return to Discord.</p>
<p>Your Discord bot is now authorized to access the API on your behalf.</p>
</div> </div>
</body> </body>
</html> </html>

View File

@ -82,7 +82,7 @@ class OAuthCog(commands.Cog):
if token: if token:
# Token is available locally, send a success message # Token is available locally, send a success message
await channel.send( await channel.send(
f"<@{user_id}> ✅ Authentication successful! You can now use the API." f"<@{user_id}> ✅ Authentication successful!"
) )
return return
@ -116,7 +116,7 @@ class OAuthCog(commands.Cog):
user_id, token_data user_id, token_data
) )
await channel.send( await channel.send(
f"<@{user_id}> ✅ Authentication successful! You can now use the API." f"<@{user_id}> ✅ Authentication successful!"
) )
return return
except Exception as e: except Exception as e:
@ -140,8 +140,7 @@ class OAuthCog(commands.Cog):
# Send a DM to the user # Send a DM to the user
try: try:
await discord_user.send( await discord_user.send(
f"✅ Authentication successful! You are now logged in as {user_info.get('username')}#{user_info.get('discriminator')}.\n" f"✅ Authentication successful! You are now logged in as {user_info.get('username')}#{user_info.get('discriminator')}."
f"Your Discord bot is now authorized to access the API on your behalf."
) )
except discord.errors.Forbidden: except discord.errors.Forbidden:
# If we can't send a DM, try to find the channel where the auth command was used # If we can't send a DM, try to find the channel where the auth command was used
@ -296,7 +295,7 @@ class OAuthCog(commands.Cog):
await ctx.send( await ctx.send(
f"✅ You are authenticated as {username}#{discriminator}.\n" f"✅ You are authenticated as {username}#{discriminator}.\n"
f"The bot can access the API on your behalf." f"The bot can access any scopes granted by this token."
) )
return return
except discord_oauth.OAuthError: except discord_oauth.OAuthError:
@ -350,7 +349,7 @@ class OAuthCog(commands.Cog):
await ctx.send( await ctx.send(
f"✅ You are authenticated as {username}#{discriminator}.\n" f"✅ You are authenticated as {username}#{discriminator}.\n"
f"The bot can access the API on your behalf.\n" f"The bot can access any scopes you allowed when authenticating.\n"
f"(Token retrieved from API service)" f"(Token retrieved from API service)"
) )
return return
@ -382,7 +381,7 @@ class OAuthCog(commands.Cog):
embed.add_field( embed.add_field(
name="!auth", name="!auth",
value="Authenticate with Discord to allow the bot to access the API on your behalf", value="Authenticate with Discord to allow the bot to access additional OAuth scopes",
inline=False, inline=False,
) )
@ -401,5 +400,5 @@ class OAuthCog(commands.Cog):
await ctx.send(embed=embed) await ctx.send(embed=embed)
async def setup(bot): async def setup(bot: commands.Bot):
await bot.add_cog(OAuthCog(bot)) await bot.add_cog(OAuthCog(bot))

View File

@ -76,7 +76,6 @@ async def handle_oauth_callback(request: web.Request) -> web.Response:
<p>You have successfully authenticated with Discord.</p> <p>You have successfully authenticated with Discord.</p>
<div class="info"> <div class="info">
<p>You can now close this window and return to Discord.</p> <p>You can now close this window and return to Discord.</p>
<p>Your Discord bot is now authorized to access the API on your behalf.</p>
</div> </div>
</body> </body>
</html> </html>