WolfDispatcher::sendMedia
Universal method for sending different types of media and files to chat.
Usage examples: $this->sendMedia('photo', 'https://example.com/image.jpg', 'Photo caption'); $this->sendMedia('video', 'https://example.com/video.mp4', 'Video description'); $this->sendMedia('audio', 'https://example.com/audio.mp3', 'Song title'); $this->sendMedia('document', 'https://example.com/file.pdf', 'Document name'); $this->sendMedia('location', '48.253449, 24.926184'); $this->sendMedia('venue', '48.253449, 24.926184', '', '', '', array('address' => 'Mountain', 'title' => 'Jesus lives here'));
Signature
protected function sendMedia(string
$type,
string
$urlOrData,
[string
$caption = '',
[string
$chatId = '',
[string
$replyToMsgId = '',
[array
$additionalData = ]]]] )
Parameters
$type— string- media type: photo, video, audio, document, location, venue
$urlOrData— string- media URL or data
$caption— string- media caption
$chatId— string- chat ID (optional, default is current chat ID)
$replyToMsgId— string- reply to message ID
$additionalData— array- additional data for venue (optional, default is empty array)
Returns
- array