Add Help command

This commit is contained in:
2022-12-30 01:40:01 +00:00
parent fbda5ff157
commit cab5744efd

View File

@@ -0,0 +1,34 @@
<?php
namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\ServerResponse;
class HelpCommand extends UserCommand
{
/** @var string */
protected $name = 'help';
/** @var string */
protected $description = 'Show bot commands help';
/** @var string */
protected $usage = '/help';
/** @var string */
protected $version = '1.0.0';
public function execute(): ServerResponse
{
return $this->replyToChat(
<<<END
This bots detects a Twitter link and reply with a [FixTweet](https://github.com/FixTweet/FixTweet) replacement.
_If added to a group chat, the bot has to be able to read all the messages._
END, [
'parse_mode' => 'markdown',
'disable_web_page_preview' => true,
]);
}
}