BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
www
/
app.imagivibe.com
/
vendor
/
irazasyed
/
telegram-bot-sdk
/
src
/
Commands
📤 Upload
📝 New File
📁 New Folder
Close
Editing: HelpCommand.php
<?php namespace Telegram\Bot\Commands; /** * Class HelpCommand. */ final class HelpCommand extends Command { /** * @var string Command Name */ protected string $name = 'help'; /** * @var array Command Aliases */ protected array $aliases = ['listcommands']; /** * @var string Command Description */ protected string $description = 'Get a list of available commands'; /** * {@inheritdoc} */ public function handle(): void { $commands = $this->telegram->getCommandBus()->getCommands(); $text = ''; foreach ($commands as $name => $handler) { $text .= sprintf('/%s - %s'.PHP_EOL, $name, $handler->getDescription()); } $this->replyWithMessage(['text' => $text]); } }
Save
Cancel