|
3 | 3 | namespace TelegramBot\Api;
|
4 | 4 |
|
5 | 5 | use TelegramBot\Api\Types\ArrayOfChatMemberEntity;
|
| 6 | +use TelegramBot\Api\Types\ArrayOfMessageEntity; |
6 | 7 | use TelegramBot\Api\Types\ArrayOfMessages;
|
7 | 8 | use TelegramBot\Api\Types\ArrayOfUpdates;
|
8 | 9 | use TelegramBot\Api\Types\Chat;
|
@@ -341,6 +342,50 @@ public function sendMessage(
|
341 | 342 | ]));
|
342 | 343 | }
|
343 | 344 |
|
| 345 | + /** |
| 346 | + * @param int|string $chatId |
| 347 | + * @param int|string $fromChatId |
| 348 | + * @param int $messageId |
| 349 | + * @param string|null $caption |
| 350 | + * @param string|null $parseMode |
| 351 | + * @param ArrayOfMessageEntity|null $captionEntities |
| 352 | + * @param bool $disableNotification |
| 353 | + * @param int|null $replyToMessageId |
| 354 | + * @param bool $allowSendingWithoutReply |
| 355 | + * @param Types\ReplyKeyboardMarkup|Types\ReplyKeyboardHide|Types\ForceReply| |
| 356 | + * Types\ReplyKeyboardRemove|null $replyMarkup |
| 357 | + * |
| 358 | + * @return Message |
| 359 | + * @throws Exception |
| 360 | + * @throws HttpException |
| 361 | + * @throws InvalidJsonException |
| 362 | + */ |
| 363 | + public function copyMessage( |
| 364 | + $chatId, |
| 365 | + $fromChatId, |
| 366 | + $messageId, |
| 367 | + $caption = null, |
| 368 | + $parseMode = null, |
| 369 | + $captionEntities = null, |
| 370 | + $disableNotification = false, |
| 371 | + $replyToMessageId = null, |
| 372 | + $allowSendingWithoutReply = false, |
| 373 | + $replyMarkup = null |
| 374 | + ) { |
| 375 | + return Message::fromResponse($this->call('sendMessage', [ |
| 376 | + 'chat_id' => $chatId, |
| 377 | + 'from_chat_id' => $fromChatId, |
| 378 | + 'message_id' => (int)$messageId, |
| 379 | + 'caption' => $caption, |
| 380 | + 'parse_mode' => $parseMode, |
| 381 | + 'caption_entities' => $captionEntities, |
| 382 | + 'disable_notification' => (bool)$disableNotification, |
| 383 | + 'reply_to_message_id' => (int)$replyToMessageId, |
| 384 | + 'allow_sending_without_reply' => (bool)$allowSendingWithoutReply, |
| 385 | + 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
| 386 | + ])); |
| 387 | + } |
| 388 | + |
344 | 389 | /**
|
345 | 390 | * Use this method to send phone contacts
|
346 | 391 | *
|
|
0 commit comments