admin管理员组文章数量:1401167
I can't find how can I send a video message(round), not like a simple video
var inputFile = await Client.UploadFileAsync(filePath);
await Client.SendMediaAsync(peer, "Here's a round video:", inputFile);
I can't find how can I send a video message(round), not like a simple video
var inputFile = await Client.UploadFileAsync(filePath);
await Client.SendMediaAsync(peer, "Here's a round video:", inputFile);
Share
Improve this question
asked Mar 23 at 23:08
Rafael ChasmanRafael Chasman
32 bronze badges
1
- What format is the video in? Does the recipient have support for the video format? Can you show details of the video in question? – Charles Henington Commented Mar 23 at 23:35
1 Answer
Reset to default 0Your MPEG4 source video must have square dimensions, up to 1 minute long.
Then you can use the following code (adjusted for correct duration/width/height)
var inputFile = await Client.UploadFileAsync("video.mp4");
var media = new InputMediaUploadedDocument
{
file = inputFile,
mime_type = "video/mp4",
attributes =
[
new DocumentAttributeVideo
{
flags = DocumentAttributeVideo.Flags.round_message,
duration = 56, // fill duration here
w = 454, // fill width / height
h = 454
}
]
};
var msg = await Client.SendMessageAsync(peer, null, media);
本文标签: telegramHow to send a video messageStack Overflow
版权声明:本文标题:telegram - How to send a video message - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744265966a2597946.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论