onboarding: Manage occurrence of 'help' command.

"help" command occurs in the command list in
initial pms or when bot doesn't understand the message. It doesn't
occur when the bot is respoding to the "help" command itself.
This commit is contained in:
Palash 2021-12-07 00:25:22 +05:30 committed by Tim Abbott
parent 3cd543ee98
commit e1796b0c8f
2 changed files with 5 additions and 5 deletions

View File

@ -93,7 +93,7 @@ def send_initial_pms(user: UserProfile) -> None:
)
+ "\n\n",
_("Here are a few messages I understand:") + " ",
bot_commands(is_initial_pm=True),
bot_commands(),
]
)
@ -109,7 +109,7 @@ def send_initial_pms(user: UserProfile) -> None:
)
def bot_commands(is_initial_pm: bool = False) -> str:
def bot_commands(no_help_command: bool = False) -> str:
commands = [
"apps",
"profile",
@ -119,7 +119,7 @@ def bot_commands(is_initial_pm: bool = False) -> str:
"message formatting",
"keyboard shortcuts",
]
if is_initial_pm:
if not no_help_command:
commands.append("help")
return ", ".join(["`" + command + "`" for command in commands]) + "."
@ -201,7 +201,7 @@ def select_welcome_bot_response(human_response_lower: str) -> str:
return "".join(
[
_("Here are a few messages I understand:") + " ",
bot_commands() + "\n\n",
bot_commands(no_help_command=True) + "\n\n",
_(
"Check out our [Getting started guide](/help/getting-started-with-zulip), "
"or browse the [Help center](/help/) to learn more!"

View File

@ -159,7 +159,7 @@ class TutorialTests(ZulipTestCase):
expected_response = (
"Im sorry, I did not understand your message. Please try one of the following commands: "
"`apps`, `profile`, `theme`, `streams`, "
"`topics`, `message formatting`, `keyboard shortcuts`."
"`topics`, `message formatting`, `keyboard shortcuts`, `help`."
)
self.assertEqual(most_recent_message(user).content, expected_response)