public function testKeyboard() { $keyboard = ReplyKeyboardEntry::create()->addRow([KeyboardButtonEntry::create('first_line_1'), KeyboardButtonEntry::create('first_line_2')])->addRow([KeyboardButtonEntry::create('contact', true)])->addRow([KeyboardButtonEntry::create('location', false, true)])->setResizeKeyboard(true)->setSelective(false)->setOneTimeKeyboard(true); /** @var MessageEntry $message */ $message = MessageEntry::create()->text($this->faker->text)->to(self::CHAT_ID)->withReplyKeyboard($keyboard); $this->bot->sendMessage($message); $message->hideReplyKeyboard(); $this->bot->sendMessage($message); $this->bot->sendTextMessage(self::CHAT_ID, $this->faker->text); }
public function sendTextMessage($to, $text) { return $this->sendMessage(MessageEntry::create()->to($to)->text($text)); }