コード例 #1
0
ファイル: sendVenue.cs プロジェクト: Eptagone/Telegram.BotAPI
        public static Message SendVenue(this BotClient bot, SendVenueArgs args)
        {
            if (bot == default)
            {
                throw new ArgumentNullException(nameof(bot));
            }

            return(bot.RPC <Message>(MethodNames.SendVenue, args));
        }
コード例 #2
0
ファイル: sendVenue.cs プロジェクト: Eptagone/Telegram.BotAPI
        public static async Task <Message> SendVenueAsync(this BotClient bot, SendVenueArgs 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.SendVenue, args, cancellationToken : cancellationToken).ConfigureAwait(false));
        }
コード例 #3
0
ファイル: sendVenue.cs プロジェクト: Eptagone/Telegram.BotAPI
        public static Message SendVenue(this BotClient api, long chatId, float latitude, float longitude, string title, string address, [Optional] string?foursquareId, [Optional] string?foursquareType, [Optional] string?googlePlaceId, [Optional] string?googlePlaceType, [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 SendVenueArgs(chatId, latitude, longitude, title, address)
            {
                FoursquareId             = foursquareId,
                FoursquareType           = foursquareType,
                GooglePlaceId            = googlePlaceId,
                GooglePlaceType          = googlePlaceType,
                DisableNotification      = disableNotification,
                ProtectContent           = protectContent,
                ReplyToMessageId         = replyToMessageId,
                AllowSendingWithoutReply = allowSendingWithoutReply,
                ReplyMarkup = replyMarkup
            };

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