| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function execute() |
||
| 43 | { |
||
| 44 | $message = $this->getMessage(); |
||
| 45 | |||
| 46 | $chat_id = $message->getChat()->getId(); |
||
| 47 | $member = $message->getNewChatMember(); |
||
| 48 | $text = 'Hi there!'; |
||
| 49 | |||
| 50 | if (!$message->botAddedInChat()) { |
||
| 51 | $text = 'Hi ' . $member->tryMention() . '!'; |
||
| 52 | } |
||
| 53 | |||
| 54 | $data = [ |
||
| 55 | 'chat_id' => $chat_id, |
||
| 56 | 'text' => $text, |
||
| 57 | ]; |
||
| 58 | |||
| 59 | return Request::sendMessage($data); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |