diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 6483de26adb..e5bf3675724 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -3633,8 +3633,22 @@ async def _set_api( else: if ctx.bot_permissions.manage_messages: await ctx.message.delete() + embed = discord.Embed() + for api_service_name, token in tokens.items(): + if token.startswith("<") and token.endswith(">"): + angle_bracket_warning = ( + "You may have failed to properly format your {api_service_name}. If you were told to enter a key" + " with an example such as [p]set api {service} api_key , and your API key" + " was HREDFGWE, make sure to run [p]set api {service} api_key HREDFGWE, and not " + " [p]set api {service} api_key " + ).format(api_service_name=api_service_name, service=service) + log.warning(angle_bracket_warning) + embed.add_field(name=_("Warning"), value=_(angle_bracket_warning)) await ctx.bot.set_shared_api_tokens(service, **tokens) - await ctx.send(_("`{service}` API tokens have been set.").format(service=service)) + await ctx.send( + _("`{service}` API tokens have been set.").format(service=service), + embed=embed if len(embed.fields) > 0 else None, + ) @_set_api.command(name="list") async def _set_api_list(self, ctx: commands.Context):