示例#1
0
 /**
  * Returns the id of the chat the message was received in
  * @return int
  */
 public function getFromChatId()
 {
     return $this->chat->getId();
 }
示例#2
0
 /**
  * Forwards the given $message to a $target.
  * If $source is not given, the chat of $message will be used
  * @param \Tekook\TelegramLibrary\Types\IChat $target The recipient
  * @param \Tekook\TelegramLibrary\Types\IMessage $message The message to forward
  * @param \Tekook\TelegramLibrary\Types\IChat $source Optional source chat
  * @return \stdClass
  */
 public function forwardMessage(\Tekook\TelegramLibrary\Types\IChat $target, \Tekook\TelegramLibrary\Types\IMessage $message, \Tekook\TelegramLibrary\Types\IChat $source = null)
 {
     if ($source == null) {
         $source_id = $message->getFromChatId();
     } else {
         $source_id = $source->getId();
     }
     return $this->call("forwardMessage", ["chat_id" => $target->getId(), "from_chat_id" => $source_id, "message_id" => $message->getMessageId()]);
 }