Use this method to send videos. nandbox clients support mp4 videos (other formats may be sent as documents). On success, the sent message is returned.
📘 Bots can currently send phot files of up to 50 MB in size, this limit may be changed in the future.
Field
Type
Required
Description
method
String
Yes
"sendVideo"
chat_id
String
Yes
Unique identifier for the target Chat or User_id.
video
String
Yes
Video to send: Pass a media_id as a string to send a video that exists on the nandbox servers (recommended), and pass an HTTP URL as a string for nandbox to get a video from the Internet.
caption
String
Optional
Video caption: 0-256 characters.
disable_web_page_preview
Boolean
Optional
Disables link previews for links in this message
disable_notification
Boolean
Optional
Sends the message silently: Users will receive a notification with no sound.
reply_to_message_id
String
Optional
The ID of the original message indicates if the message is a reply.
reference
Long
Yes
Unique local identifier for the target Chat or User.
to_user_id
String
Optional
Unique identifier of the target user if a user replies or sends a message to the target user within a Group or Channel.
echo
Integer
Optional
1= repeat message 0= no echo
menu_ref
String
Optional
Menu reference for an existing predefined menu: the menu will be displayed as an inline menu associated with the message.
inline_menu
Array of Menu
Optional
Inline menu object to hold menus: if both inline_menu and menu_ref are defined, the priority goes to inline_menu.
chat_settings
Integer
Optional
1: if you want to send to bot chat settings

Requests

json
{ "method": "sendVideo", "chat_id": "54874436001458887", "reference": 47412587466621020, "video": "190717a3076b1eeac6ba555a2924179e9046bf2ceb28389f39d22dc697c54219.mp4", "caption": "Waterfall", "echo": 2 }
java
// SEND VIDEO else if (incomingMsg.getText().toLowerCase().equals("video")) { String uploadedVideoId = MediaTransfer.uploadFile(TOKEN, System.getProperty("user.dir") + "/src/main/resources/upload/recallTest.mp4"); VideoOutMessage videoMsg = new VideoOutMessage(); videoMsg.setChatId(incomingMsg.getChat().getId()); videoMsg.setReference(Utils.getUniqueId()); videoMsg.setCaption("Video From Bot"); if (uploadedVideoId != null) { videoMsg.setVideo(uploadedVideoId); api.send(videoMsg); } else { System.out.println("Upload Failed"); } }
javascript
MediaTransfer.uploadFile(TOKEN, "./your_video.mp4", config.UploadServer) .then((uploadedVideoId) => { let vidoMsg = new VideoOutMessage(); vidoMsg.chat_id = incomingMsg.chat.id; vidoMsg.reference = Id(); vidoMsg.video = uploadedVideoId; vidoMsg.caption = "Video From Bot"; vidoMsg.echo = 0; api.send(JSON.stringify(vidoMsg)); }) .catch((e) => console.log("Upload failed", e));
python
napi.send_video("chatId","videoId",Utils.get_unique_id())

Response

json
{ "method": "message", "message": { "date": 1600168078602, "reference": 2097, "chat": { "name": "Alice Park", "id": "90089668723575679", "terminal": "Mobile", "type": "Contact", "version": "('0HNt','1QBk','2c2H','31RN')" }, "sent_to": { "id": "90091903321704167" }, "message_id": "i1_CD11KwDr126551", "style": 6, "from": { "name": "Alice Park", "id": "90089668723575679", "terminal": "Mobile", "type": "Contact", "version": "('0HNt','1QBk','2c2H','31RN')" }, "text": "Hello", "type": "text" } }

Powered by Notaku