1 | <?php |
||
20 | class MarkdownCommand extends UserCommand |
||
21 | { |
||
22 | /**#@+ |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | protected $name = 'markdown'; |
||
26 | protected $description = 'Print Markdown tesxt'; |
||
27 | protected $usage = '/markdown'; |
||
28 | protected $version = '1.0.1'; |
||
29 | /**#@-*/ |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function execute() |
||
35 | { |
||
36 | $message = $this->getMessage(); |
||
37 | $chat_id = $message->getChat()->getId(); |
||
38 | |||
39 | $data = [ |
||
40 | 'chat_id' => $chat_id, |
||
41 | 'parse_mode' => 'MARKDOWN', |
||
42 | 'text' => '*bold* _italic_ `inline fixed width code` |
||
43 | ``` |
||
44 | preformatted code block |
||
45 | code block |
||
46 | ``` |
||
47 | [Best Telegram bot api!!](https://github.com/akalongman/php-telegram-bot) |
||
48 | ', |
||
49 | ]; |
||
50 | |||
51 | return Request::sendMessage($data); |
||
52 | } |
||
53 | } |
||
54 |