Exemple #1
0
        public static Message SendDice(this BotClient bot, SendDiceArgs args)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

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

            return(bot.RPC <Message>(MethodNames.SendDice, args));
        }
Exemple #2
0
        public static async Task <Message> SendDiceAsync(this BotClient bot, SendDiceArgs 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.SendDice, args, cancellationToken : cancellationToken).ConfigureAwait(false));
        }
Exemple #3
0
        public static Message SendDice(this BotClient api, string chatId, [Optional] string?emoji, [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 SendDiceArgs(chatId)
            {
                Emoji = emoji,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup = replyMarkup
            };

            return(api.RPC <Message>(MethodNames.SendDice, args));
        }
Exemple #4
0
        public static async Task <Message> SendDiceAsync(this BotClient api, string chatId, [Optional] string?emoji, [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 SendDiceArgs(chatId)
            {
                Emoji = emoji,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup = replyMarkup
            };

            return(await api.RPCA <Message>(MethodNames.SendDice, args, cancellationToken).ConfigureAwait(false));
        }