public function testGetSetChatId()
 {
     $method = new EditMessageReplyMarkup();
     $this->assertNull($method->getChatId());
     $method->setChatId('@chatid');
     $this->assertEquals('@chatid', $method->getChatId());
 }
예제 #2
0
 protected function markupCommand() : \Generator
 {
     if ($this->inlineKeyboardMarkup === null) {
         $button1 = (new InlineKeyboardButton('Edit inline text'))->setCallbackData('edit');
         $button3 = (new InlineKeyboardButton('Show text'))->setCallbackData('text');
         $button4 = (new InlineKeyboardButton('Show alert'))->setCallbackData('alert');
         $markupData = [[$button1], [$button3, $button4]];
         $this->inlineKeyboardMarkup = new InlineKeyboardMarkup($markupData);
     } else {
         $this->inlineKeyboardMarkup = null;
     }
     $method = new EditMessageReplyMarkup();
     $method->setMessageId($this->message->messageId);
     $method->setChatId($this->message->chat->id);
     $method->setReplyMarkup($this->inlineKeyboardMarkup);
     $this->message = (yield from $this->api->execute($method));
 }