Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Print a link to the guide explaining how to obtain token when Red prompts for it #3204

Merged
merged 2 commits into from
Dec 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3204.enhance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When Red prompts for token, it will now print a link to the guide explaining how to obtain a token.
9 changes: 8 additions & 1 deletion redbot/core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
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:
Expand Down Expand Up @@ -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:
Expand Down