Document and Animation Messages

Send documents

sendDocument method tests

Use sendDocument method to send general files.

Message message = await botClient.SendDocumentAsync(
    chatId: chatId,
    document: InputFile.FromUri(""),
    caption: "<b>Ara bird</b>. <i>Source</i>: <a href=\"\">Pixabay</a>",
    parseMode: ParseMode.Html,
    cancellationToken: cancellationToken);

Send animations

sendAnimation method tests

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(""),
    caption: "Waves",
    cancellationToken: cancellationToken);