From 022671c37b83a2dc4d479ec59585291389a1d261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 6 Jul 2020 13:15:42 +0200 Subject: [PATCH] Encourage users to use the bot, by linking them to the `/rules` command in the welcome message --- commands/NewchatmembersCommand.php | 2 +- commands/StartCommand.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/NewchatmembersCommand.php b/commands/NewchatmembersCommand.php index 66a0625..9377835 100644 --- a/commands/NewchatmembersCommand.php +++ b/commands/NewchatmembersCommand.php @@ -96,7 +96,7 @@ private function refreshWelcomeMessage(array $new_users): ServerResponse $text = "Welcome {$new_users_text} to the {$this->group_name} group\n"; $text .= 'Please remember that this is NOT the Telegram Support Chat.' . PHP_EOL; - $text .= 'Read the Rules that apply here.'; + $text .= 'Read the Rules that apply here.'; $welcome_message_sent = $this->replyToChat($text, ['parse_mode' => 'HTML', 'disable_web_page_preview' => true]); if (!$welcome_message_sent->isOk()) { diff --git a/commands/StartCommand.php b/commands/StartCommand.php index 9e9984b..a613234 100644 --- a/commands/StartCommand.php +++ b/commands/StartCommand.php @@ -53,6 +53,10 @@ class StartCommand extends SystemCommand */ public function execute(): ServerResponse { + if ('rules' === $this->getMessage()->getText(true)) { + return $this->getTelegram()->executeCommand('rules'); + } + return $this->getTelegram()->executeCommand('help'); } }