Skip to content

Commit

Permalink
Ask for confirmation before setting prefix on first-time setup (#6287)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Oliveira <[email protected]>
  • Loading branch information
Jackenmen and Flame442 authored Feb 26, 2024
1 parent 185b607 commit 9345b69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion redbot/core/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def interactive_config(red, token_set, prefix_set, *, print_header=True):
print(
"\nPick a prefix. A prefix is what you type before a "
"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 "
"later and add more of them.\nChoose your prefix:\n"
)
Expand All @@ -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."
)
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:
await red._config.prefix.set([prefix])

Expand Down

0 comments on commit 9345b69

Please sign in to comment.