From 9270373c5689dfaa68aa5cdce02cf62f1614d17f Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Sun, 15 Mar 2026 12:57:14 +0100 Subject: [PATCH] Update Spotify API instructions + use SetApiView (#6699) --- redbot/cogs/audio/core/commands/audioset.py | 41 ++++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/redbot/cogs/audio/core/commands/audioset.py b/redbot/cogs/audio/core/commands/audioset.py index 0e332378b..274afa627 100644 --- a/redbot/cogs/audio/core/commands/audioset.py +++ b/redbot/cogs/audio/core/commands/audioset.py @@ -16,6 +16,7 @@ from redbot.core.i18n import Translator from redbot.core.utils.chat_formatting import box, humanize_number from redbot.core.utils.menus import menu, start_adding_reactions from redbot.core.utils.predicates import MessagePredicate, ReactionPredicate +from redbot.core.utils.views import SetApiView from ...audio_dataclasses import LocalPath from ...converters import ScopeParser @@ -1280,26 +1281,38 @@ class AudioSetCommands(MixinMeta, metaclass=CompositeMetaClass): "6. Click on Create Credential at the top.\n" '7. At the top click the link for "API key".\n' "8. No application restrictions are needed. Click Create at the bottom.\n" - "9. You now have a key to add to `{prefix}set api youtube api_key `" - ).format(prefix=ctx.prefix) - await ctx.maybe_send_embed(message) + "9. Click the button below this message and set your API key" + " with the data shown in Google Developers Console." + ) + await ctx.send( + message, + view=SetApiView(default_service="youtube", default_keys={"api_key": ""}), + ) @command_audioset.command(name="spotifyapi") @commands.is_owner() async def command_audioset_spotifyapi(self, ctx: commands.Context): """Instructions to set the Spotify API tokens.""" message = _( - "1. Go to Spotify developers and log in with your Spotify account.\n" - "(https://developer.spotify.com/dashboard/applications)\n" - '2. Click "Create An App".\n' - "3. Fill out the form provided with your app name, etc.\n" - '4. When asked if you\'re developing commercial integration select "No".\n' - "5. Accept the terms and conditions.\n" - "6. Copy your client ID and your client secret into:\n" - "`{prefix}set api spotify client_id " - "client_secret `" - ).format(prefix=ctx.prefix) - await ctx.maybe_send_embed(message) + "1. Go to Spotify for Developers and log in with your Spotify account." + " If this is your first time, you'll be asked to accept the terms and conditions.\n" + "(https://developer.spotify.com/dashboard)\n" + '2. Click "Create app".\n' + "3. Fill out the form provided with your app name and description." + " These can be anything you want. Website field can be left empty.\n" + "4. Add `https://localhost` to your Redirect URIs. This will not be used" + " but is required when filling out the form.\n" + '5. Select "Web API" when asked which API/SDKs you are planning to use.\n' + "6. Confirm that you agree to the terms and conditions and save the application.\n" + "7. Click the button below this message and set your client ID and your client secret" + " with the data shown in Spotify's dashboard." + ) + await ctx.send( + message, + view=SetApiView( + default_service="spotify", default_keys={"client_id": "", "client_secret": ""} + ), + ) @command_audioset.command(name="countrycode") @commands.guild_only()