Exemple #1
0
 /**
  * forwardMessage
  * Use this method to forward messages of any kind. On success, the sent Message is returned.
  *
  * @param Chat    $chat
  * @param Chat    $fromChat
  * @param Message $message
  *
  * @return Message
  */
 public function forwardMessage(Chat $chat, Chat $fromChat, Message $message)
 {
     $params = ['chat_id' => $chat->getId(), 'from_chat_id' => $fromChat->getId(), 'message_id' => $message->getMessageId()];
     $message = $this->Telegram->getNet()->doRequest('/forwardMessage', $params);
     return new Message($message);
 }
 /**
  * forwardMessage
  * Use this method to forward messages of any kind. On success, the sent Message is returned.
  *
  * @param Chat|string $chat Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  * @param Chat|string $fromChat Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
  * @param bool $disableNotification Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
  * @param Message $message Unique message identifier
  *
  * @return Message
  */
 public function forwardMessage($chat, $fromChat, $disableNotification, Message $message)
 {
     $params = ['chat_id' => $chat instanceof Chat ? $chat->getId() : $chat, 'from_chat_id' => $fromChat instanceof Chat ? $fromChat->getId() : $chat, 'disable_notification' => $disableNotification, 'message_id' => $message->getMessageId()];
     $message = $this->getNet()->doRequest('/forwardMessage', $params);
     return new Message($message);
 }