Beispiel #1
0
        public static Message SendGame(this BotClient bot, SendGameArgs args)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

            return(bot.RPC <Message>(MethodNames.SendGame, args));
        }
Beispiel #2
0
        public static async Task <Message> SendGameAsync(this BotClient bot, SendGameArgs args, [Optional] CancellationToken cancellationToken)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

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

            return(await bot.RPCA <Message>(MethodNames.SendGame, args, cancellationToken : cancellationToken).ConfigureAwait(false));
        }
Beispiel #3
0
        public static async Task <Message> SendGameAsync(this BotClient api, long chatId, string gameShortName, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] InlineKeyboardMarkup?replyMarkup, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SendGameArgs(chatId, gameShortName)
            {
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup = replyMarkup
            };

            return(await api.RPCA <Message>(MethodNames.SendGame, args, cancellationToken).ConfigureAwait(false));
        }
Beispiel #4
0
        public static Message SendGame(this BotClient api, long chatId, string gameShortName, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] InlineKeyboardMarkup?replyMarkup)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new SendGameArgs(chatId, gameShortName)
            {
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup = replyMarkup
            };

            return(api.RPC <Message>(MethodNames.SendGame, args));
        }