示例#1
0
        public static async Task <Message> SendVideoNoteAsync(this BotClient bot, SendVideoNoteArgs 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.SendVideoNote, args, cancellationToken : cancellationToken).ConfigureAwait(false));
        }
示例#2
0
        public static Message SendVideoNote(this BotClient bot, SendVideoNoteArgs args)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

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

            return(bot.RPCF <Message>(MethodNames.SendVideoNote, args));
        }
示例#3
0
        public static Message SendVideoNote(this BotClient api, long chatId, InputFile videoNote, [Optional] uint?duration, [Optional] uint?length, [Optional] InputFile?thumb, [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 SendVideoNoteArgs(chatId, videoNote)
            {
                Duration                 = duration,
                Length                   = length,
                Thumb                    = thumb,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup              = replyMarkup
            };

            return(api.RPCF <Message>(MethodNames.SendVideoNote, args));
        }
示例#4
0
        public static async Task <Message> SendVideoNoteAsync(this BotClient api, string chatId, InputFile videoNote, [Optional] uint?duration, [Optional] uint?length, [Optional] InputFile?thumb, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] ReplyMarkup?replyMarkup, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SendVideoNoteArgs(chatId, videoNote)
            {
                Duration                 = duration,
                Length                   = length,
                Thumb                    = thumb,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup              = replyMarkup
            };

            return(await api.RPCAF <Message>(MethodNames.SendVideoNote, args, cancellationToken).ConfigureAwait(false));
        }
示例#5
0
        public static Message SendVideoNote(this BotClient api, string chatId, string videoNote, [Optional] uint?duration, [Optional] uint?length, [Optional] string?thumb, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] ReplyMarkup?replyMarkup, [Optional] IEnumerable <AttachedFile>?attachedFiles)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SendVideoNoteArgs(chatId, videoNote)
            {
                Duration                 = duration,
                Length                   = length,
                Thumb                    = thumb,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup              = replyMarkup,
                AttachedFiles            = attachedFiles == null ? new List <AttachedFile>() : new List <AttachedFile>(attachedFiles)
            };

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