Ask for confirmation before setting prefix on first-time setup (#6287)

Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
Jakub Kuczys 2024-02-27 00:15:07 +01:00 committed by GitHub
parent 185b607544
commit 9345b691b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,7 +80,7 @@ async def interactive_config(red, token_set, prefix_set, *, print_header=True):
print( print(
"\nPick a prefix. A prefix is what you type before a " "\nPick a prefix. A prefix is what you type before a "
"command. Example:\n" "command. Example:\n"
"!help\n^ The exclamation mark is the prefix in this case.\n" "!help\n^ The exclamation mark (!) is the prefix in this case.\n"
"The prefix can be multiple characters. You will be able to change it " "The prefix can be multiple characters. You will be able to change it "
"later and add more of them.\nChoose your prefix:\n" "later and add more of them.\nChoose your prefix:\n"
) )
@ -94,6 +94,12 @@ async def interactive_config(red, token_set, prefix_set, *, print_header=True):
"Prefixes cannot start with '/', as it conflicts with Discord's slash commands." "Prefixes cannot start with '/', as it conflicts with Discord's slash commands."
) )
prefix = "" prefix = ""
if prefix and not confirm(
f'You chose "{prefix}" as your prefix. To run the help command,'
f" you will have to send:\n{prefix}help\n\n"
"Do you want to continue with this prefix?"
):
prefix = ""
if prefix: if prefix:
await red._config.prefix.set([prefix]) await red._config.prefix.set([prefix])