public static async Task <Message> SendAnimationAsync(this BotClient api, string chatId, string animation, [Optional] uint?duration, [Optional] uint?width, [Optional] uint?height, [Optional] string?thumb, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] ReplyMarkup?replyMarkup, [Optional] IEnumerable <AttachedFile>?attachedFiles, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SendAnimationArgs(chatId, animation)
            {
                Duration                 = duration,
                Width                    = width,
                Height                   = height,
                Thumb                    = thumb,
                Caption                  = caption,
                ParseMode                = parseMode,
                CaptionEntities          = captionEntities,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup              = replyMarkup,
                AttachedFiles            = attachedFiles == null ? new List <AttachedFile>() : new List <AttachedFile>(attachedFiles)
            };

            return(await api.RPCAF <Message>(MethodNames.SendAnimation, args, cancellationToken).ConfigureAwait(false));
        }
        public static async Task <Message> SendAnimationAsync(this BotClient bot, SendAnimationArgs args, [Optional] CancellationToken cancellationToken)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

            if (args == default)
            {
                throw new ArgumentNullException(nameof(args));
            }

            return(await bot.RPCAF <Message>(MethodNames.SendAnimation, args, cancellationToken).ConfigureAwait(false));
        }
        public static Message SendAnimation(this BotClient bot, SendAnimationArgs args)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

            if (args == default)
            {
                throw new ArgumentNullException(nameof(args));
            }

            return(bot.RPCF <Message>(MethodNames.SendAnimation, args));
        }
        public static Message SendAnimation(this BotClient api, long chatId, InputFile animation, [Optional] uint?duration, [Optional] uint?width, [Optional] uint?height, [Optional] InputFile?thumb, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] ReplyMarkup?replyMarkup)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SendAnimationArgs(chatId, animation)
            {
                Duration                 = duration,
                Width                    = width,
                Height                   = height,
                Thumb                    = thumb,
                Caption                  = caption,
                ParseMode                = parseMode,
                CaptionEntities          = captionEntities,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup              = replyMarkup
            };

            return(api.RPCF <Message>(MethodNames.SendAnimation, args));
        }