Пример #1
0
 /**
  * @param Music $message
  *
  * @return array
  */
 private function formatMusicForPush(Music $message)
 {
     $out = [];
     $out['musicurl'] = $message->getSourceURL();
     $out['hqmusicurl'] = $message->getHighQualitySourceURL();
     $out['thumb_media_id'] = $message->getThumbnailID();
     if ($message->getTitle() !== null) {
         $out['title'] = $message->getTitle();
     }
     if ($message->getDescription() !== null) {
         $out['description'] = $message->getDescription();
     }
     return $out;
 }
Пример #2
0
 /**
  * Sends a music reply.
  * 
  * @param Type\Music $musicMessage
  *
  * @throws Exception\AlreadySentException
  */
 public function sendMusic(Type\Music $musicMessage)
 {
     $this->sendReply($this->buildMessage(['MsgType' => $musicMessage->getType(), ucfirst($musicMessage->getType()) => ['Title' => $musicMessage->getTitle(), 'Description' => $musicMessage->getDescription(), 'MusicUrl' => $musicMessage->getSourceURL(), 'HQMusicUrl' => $musicMessage->getHighQualitySourceURL(), 'ThumbMediaId' => $musicMessage->getThumbnailID()]]));
 }