|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\Button; |
| 13 | + |
| 14 | +/** |
| 15 | + * @author Mihail Krasilnikov <mihail.krasilnikov.j@gmail.com> |
| 16 | + * @see https://core.telegram.org/bots/api#inlinekeyboardbutton |
| 17 | + */ |
| 18 | +class InlineKeyboardButton extends AbstractKeyboardButton |
| 19 | +{ |
| 20 | + public function __construct(string $text = '') |
| 21 | + { |
| 22 | + $this->options['text'] = $text; |
| 23 | + } |
| 24 | + |
| 25 | + public function url(string $url): self |
| 26 | + { |
| 27 | + $this->options['url'] = $url; |
| 28 | + |
| 29 | + return $this; |
| 30 | + } |
| 31 | + |
| 32 | + public function loginUrl(string $url): self |
| 33 | + { |
| 34 | + $this->options['login_url']['url'] = $url; |
| 35 | + |
| 36 | + return $this; |
| 37 | + } |
| 38 | + |
| 39 | + public function loginUrlForwardText(string $text): self |
| 40 | + { |
| 41 | + $this->options['login_url']['forward_text'] = $text; |
| 42 | + |
| 43 | + return $this; |
| 44 | + } |
| 45 | + |
| 46 | + public function requestWriteAccess(bool $bool): self |
| 47 | + { |
| 48 | + $this->options['login_url']['request_write_access'] = $bool; |
| 49 | + |
| 50 | + return $this; |
| 51 | + } |
| 52 | + |
| 53 | + public function callbackData(string $data): self |
| 54 | + { |
| 55 | + $this->options['callback_data'] = $data; |
| 56 | + |
| 57 | + return $this; |
| 58 | + } |
| 59 | + |
| 60 | + public function switchInlineQuery(string $query): self |
| 61 | + { |
| 62 | + $this->options['switch_inline_query'] = $query; |
| 63 | + |
| 64 | + return $this; |
| 65 | + } |
| 66 | + |
| 67 | + public function payButton(bool $bool): self |
| 68 | + { |
| 69 | + $this->options['pay'] = $bool; |
| 70 | + |
| 71 | + return $this; |
| 72 | + } |
| 73 | +} |
0 commit comments