Document and Animation Messages
Send documents
Use sendDocument
method to send general files.
Message message = await botClient.SendDocumentAsync(
chatId: chatId,
document: InputFile.FromUri("https://github.com/TelegramBots/book/raw/master/src/docs/photo-ara.jpg"),
caption: "<b>Ara bird</b>. <i>Source</i>: <a href=\"https://pixabay.com\">Pixabay</a>",
parseMode: ParseMode.Html,
cancellationToken: cancellationToken);
Send animations
Use sendAnimation
method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
Message message = await botClient.SendAnimationAsync(
chatId: chatId,
animation: InputFile.FromUri("https://raw.githubusercontent.com/TelegramBots/book/master/src/docs/video-waves.mp4"),
caption: "Waves",
cancellationToken: cancellationToken);