[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
This commit is contained in:
jack1142 2019-12-21 09:55:32 +01:00 committed by Michael H
parent a36e95c286
commit b72c05d3d4
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1 @@
When Red prompts for token, it will now print a link to the guide explaining how to obtain a token.

View File

@ -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: