VideoMessage¶
Represents the builder class VideoMessage, which is intended for sending videos.
Examples:
import space.zoommax.view.VideoMessage;
public class example {
public static void main(String[] args) {
VideoMessage videoMessage = VideoMessage.builder()
.chatId(123456789)
.videoAsUrl("https://example.com/video.mp4")
/*optional
.videoAsFile(new File("path/to/video.mp4"))
.videoAsBytes(new byte[]{1,2,3,4,5})
*/
.keyboard(Keyboard.builder()
.chatId(123456789)
.code("{Google;https://google.ru}{Yandex;https://ya.ru}\n" +
"{Start;strt}")
.build())
.caption("Hello")
.onMessageFlag("start")
.notify(false)
.build();
videoMessage.run();
}
}
Parameters:
chatId- the chat identifiervideoAsUrl- the URL of the videovideoAsFile- the video filevideoAsBytes- the byte array of the videocaption- the caption textkeyboard- the keyboard inKeyboardformatonMessageFlag- the flag used for processing messagesnotify- indicates whether the message is a notification. By default, it'sfalse
The message can be returned as a ViewMessage or run using the run() method.