Ejemplo n.º 1
0
        internal async Task SendPhotoAsync(string chatId, string photo, string caption = null, bool disableNotification = false,
                                           int replyToMessageId = 0, object replyMarkup = null)
        {
            var photow = new PhotoToSend
            {
                ChatId              = chatId,
                Photo               = photo,
                Caption             = caption,
                DisableNotification = disableNotification,
                ReplyToMessageId    = replyToMessageId,
                ReplyMarkup         = replyMarkup
            };

            await api.SendRequestAsync("sendPhoto", photow);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Use this method to send photos. On success, the sent Message is returned.
        /// </summary>
        public async Task <MessageResponse> SendPhotoAsync(PhotoToSend photo)
        {
            await InitAsync();

            MessageResponse result = null;

            if (photo.PhotoStream != null)
            {
                photo.Method = "POST";
                result       = await DoRequest <MessageResponse>("sendPhoto", photo);
            }
            else
            {
                photo.Method = "JSON";
                result       = await DoRequest <MessageResponse>("sendPhoto", photo);
            }

            return(result);
        }