mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2026-03-16 09:51:55 -04:00
Update Spotify API instructions + use SetApiView (#6699)
This commit is contained in:
@@ -16,6 +16,7 @@ from redbot.core.i18n import Translator
|
|||||||
from redbot.core.utils.chat_formatting import box, humanize_number
|
from redbot.core.utils.chat_formatting import box, humanize_number
|
||||||
from redbot.core.utils.menus import menu, start_adding_reactions
|
from redbot.core.utils.menus import menu, start_adding_reactions
|
||||||
from redbot.core.utils.predicates import MessagePredicate, ReactionPredicate
|
from redbot.core.utils.predicates import MessagePredicate, ReactionPredicate
|
||||||
|
from redbot.core.utils.views import SetApiView
|
||||||
|
|
||||||
from ...audio_dataclasses import LocalPath
|
from ...audio_dataclasses import LocalPath
|
||||||
from ...converters import ScopeParser
|
from ...converters import ScopeParser
|
||||||
@@ -1280,26 +1281,38 @@ class AudioSetCommands(MixinMeta, metaclass=CompositeMetaClass):
|
|||||||
"6. Click on Create Credential at the top.\n"
|
"6. Click on Create Credential at the top.\n"
|
||||||
'7. At the top click the link for "API key".\n'
|
'7. At the top click the link for "API key".\n'
|
||||||
"8. No application restrictions are needed. Click Create at the bottom.\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 <your_api_key_here>`"
|
"9. Click the button below this message and set your API key"
|
||||||
).format(prefix=ctx.prefix)
|
" with the data shown in Google Developers Console."
|
||||||
await ctx.maybe_send_embed(message)
|
)
|
||||||
|
await ctx.send(
|
||||||
|
message,
|
||||||
|
view=SetApiView(default_service="youtube", default_keys={"api_key": ""}),
|
||||||
|
)
|
||||||
|
|
||||||
@command_audioset.command(name="spotifyapi")
|
@command_audioset.command(name="spotifyapi")
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def command_audioset_spotifyapi(self, ctx: commands.Context):
|
async def command_audioset_spotifyapi(self, ctx: commands.Context):
|
||||||
"""Instructions to set the Spotify API tokens."""
|
"""Instructions to set the Spotify API tokens."""
|
||||||
message = _(
|
message = _(
|
||||||
"1. Go to Spotify developers and log in with your Spotify account.\n"
|
"1. Go to Spotify for Developers and log in with your Spotify account."
|
||||||
"(https://developer.spotify.com/dashboard/applications)\n"
|
" If this is your first time, you'll be asked to accept the terms and conditions.\n"
|
||||||
'2. Click "Create An App".\n'
|
"(https://developer.spotify.com/dashboard)\n"
|
||||||
"3. Fill out the form provided with your app name, etc.\n"
|
'2. Click "Create app".\n'
|
||||||
'4. When asked if you\'re developing commercial integration select "No".\n'
|
"3. Fill out the form provided with your app name and description."
|
||||||
"5. Accept the terms and conditions.\n"
|
" These can be anything you want. Website field can be left empty.\n"
|
||||||
"6. Copy your client ID and your client secret into:\n"
|
"4. Add `https://localhost` to your Redirect URIs. This will not be used"
|
||||||
"`{prefix}set api spotify client_id <your_client_id_here> "
|
" but is required when filling out the form.\n"
|
||||||
"client_secret <your_client_secret_here>`"
|
'5. Select "Web API" when asked which API/SDKs you are planning to use.\n'
|
||||||
).format(prefix=ctx.prefix)
|
"6. Confirm that you agree to the terms and conditions and save the application.\n"
|
||||||
await ctx.maybe_send_embed(message)
|
"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")
|
@command_audioset.command(name="countrycode")
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
|
|||||||
Reference in New Issue
Block a user