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:
parent
15f8c91baf
commit
d64da1aa9a
@ -1183,7 +1183,6 @@ async def auth(
|
||||
<p>You have successfully authenticated with Discord.</p>
|
||||
<div class="info">
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -82,7 +82,7 @@ class OAuthCog(commands.Cog):
|
||||
if token:
|
||||
# Token is available locally, send a success message
|
||||
await channel.send(
|
||||
f"<@{user_id}> ✅ Authentication successful! You can now use the API."
|
||||
f"<@{user_id}> ✅ Authentication successful!"
|
||||
)
|
||||
return
|
||||
|
||||
@ -116,7 +116,7 @@ class OAuthCog(commands.Cog):
|
||||
user_id, token_data
|
||||
)
|
||||
await channel.send(
|
||||
f"<@{user_id}> ✅ Authentication successful! You can now use the API."
|
||||
f"<@{user_id}> ✅ Authentication successful!"
|
||||
)
|
||||
return
|
||||
except Exception as e:
|
||||
@ -140,8 +140,7 @@ class OAuthCog(commands.Cog):
|
||||
# Send a DM to the user
|
||||
try:
|
||||
await discord_user.send(
|
||||
f"✅ Authentication successful! You are now logged in as {user_info.get('username')}#{user_info.get('discriminator')}.\n"
|
||||
f"Your Discord bot is now authorized to access the API on your behalf."
|
||||
f"✅ Authentication successful! You are now logged in as {user_info.get('username')}#{user_info.get('discriminator')}."
|
||||
)
|
||||
except discord.errors.Forbidden:
|
||||
# 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(
|
||||
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
|
||||
except discord_oauth.OAuthError:
|
||||
@ -350,7 +349,7 @@ class OAuthCog(commands.Cog):
|
||||
|
||||
await ctx.send(
|
||||
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)"
|
||||
)
|
||||
return
|
||||
@ -382,7 +381,7 @@ class OAuthCog(commands.Cog):
|
||||
|
||||
embed.add_field(
|
||||
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,
|
||||
)
|
||||
|
||||
@ -401,5 +400,5 @@ class OAuthCog(commands.Cog):
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
|
||||
async def setup(bot):
|
||||
async def setup(bot: commands.Bot):
|
||||
await bot.add_cog(OAuthCog(bot))
|
||||
|
@ -76,7 +76,6 @@ async def handle_oauth_callback(request: web.Request) -> web.Response:
|
||||
<p>You have successfully authenticated with Discord.</p>
|
||||
<div class="info">
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user