From b72c05d3d4a1e5f98453e5db41465895850a4f52 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Sat, 21 Dec 2019 09:55:32 +0100 Subject: [PATCH] [Core] Print a link to the guide explaining how to obtain token when Red prompts for it (#3204) * Update cli.py * Create 3204.enhance.rst --- changelog.d/3204.enhance.rst | 1 + redbot/core/cli.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelog.d/3204.enhance.rst diff --git a/changelog.d/3204.enhance.rst b/changelog.d/3204.enhance.rst new file mode 100644 index 000000000..e4e20823d --- /dev/null +++ b/changelog.d/3204.enhance.rst @@ -0,0 +1 @@ +When Red prompts for token, it will now print a link to the guide explaining how to obtain a token. diff --git a/redbot/core/cli.py b/redbot/core/cli.py index ead6dc905..74ce9da89 100644 --- a/redbot/core/cli.py +++ b/redbot/core/cli.py @@ -4,6 +4,8 @@ import logging import sys from typing import Optional +from discord import __version__ as discord_version + def confirm(text: str, default: Optional[bool] = None) -> bool: if default is None: @@ -39,7 +41,12 @@ def interactive_config(red, token_set, prefix_set, *, print_header=True): print("Red - Discord Bot | Configuration process\n") if not token_set: - print("Please enter a valid token:") + print( + "Please enter a valid token.\n" + "You can find out how to obtain a token with this guide" + ' (section "Creating a Bot Account"):\n' + f"https://discordpy.readthedocs.io/en/v{discord_version}/discord.html#creating-a-bot-account" + ) while not token: token = input("> ") if not len(token) >= 50: