示例#1
0
        public static bool AddStickerToSet(this BotClient bot, AddStickerToSetArgs args)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

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

            return(bot.RPCF <bool>(MethodNames.AddStickerToSet, args));
        }
示例#2
0
        public static async Task <bool> AddStickerToSetAsync(this BotClient bot, AddStickerToSetArgs args, [Optional] CancellationToken cancellationToken)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

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

            return(await bot.RPCAF <bool>(MethodNames.AddStickerToSet, args, cancellationToken : cancellationToken).ConfigureAwait(false));
        }
示例#3
0
        public static bool AddStickerToSet(this BotClient api, int userId, string name, string emojis, [Optional] string?pngSticker, [Optional] InputFile?tgsSticker, [Optional] InputFile?webmSticker, [Optional] MaskPosition?maskPosition)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new AddStickerToSetArgs(userId, name, emojis)
            {
                PngSticker   = pngSticker,
                TgsSticker   = tgsSticker,
                WebmSticker  = webmSticker,
                MaskPosition = maskPosition
            };

            return(api.RPCF <bool>(MethodNames.AddStickerToSet, args));
        }
示例#4
0
        public static async Task <bool> AddStickerToSetAsync(this BotClient api, int userId, string name, string emojis, [Optional] string?pngSticker, [Optional] InputFile?tgsSticker, [Optional] InputFile?webmSticker, [Optional] MaskPosition?maskPosition, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new AddStickerToSetArgs(userId, name, emojis)
            {
                PngSticker   = pngSticker,
                TgsSticker   = tgsSticker,
                WebmSticker  = webmSticker,
                MaskPosition = maskPosition
            };

            return(await api.RPCAF <bool>(MethodNames.AddStickerToSet, args, cancellationToken).ConfigureAwait(false));
        }