Esempio n. 1
0
        /// <summary>
        /// Use this method to send any messages. On success, the sent Message is returned.
        /// </summary>
        /// <param name="type">The <see cref="MessageType"/></param>
        /// <param name="chatId">Unique identifier for the target chat or username of the target channel (in the format @channelusername)</param>
        /// <param name="content">The content of the message. Could be a text, photo, audio, sticker, document, video or location</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <param name="additionalParameters">Optional. if additional Parameters could bei send i.e. "disable_web_page_preview" in for a TextMessage</param>
        /// <returns>On success, the sent Message is returned.</returns>
        private Task <Message> SendMessage(MessageType type, string chatId, object content,
                                           int replyToMessageId    = 0,
                                           ReplyMarkup replyMarkup = null,
                                           Dictionary <string, object> additionalParameters = null)
        {
            if (additionalParameters == null)
            {
                additionalParameters = new Dictionary <string, object>();
            }

            var typeInfo = type.ToKeyValue();

            additionalParameters.Add("chat_id", chatId);
            additionalParameters.Add("reply_markup", replyMarkup);

            if (replyToMessageId != 0)
            {
                additionalParameters.Add("reply_to_message_id", replyToMessageId);
            }

            if (!string.IsNullOrEmpty(typeInfo.Value))
            {
                additionalParameters.Add(typeInfo.Value, content);
            }

            return(SendWebRequest <Message>(typeInfo.Key, additionalParameters));
        }
        public Task <Message> SendMessageAsync(int chatId, string text, string parseMode, bool?disableWebPagePreview = null,
                                               int?replyToMessageId = null, ReplyMarkup replyMarkup = null)
        {
            var request = new RestRequest(MakeRequest("sendMessage"), Method.POST);

            request.AddQueryIntParameter("chat_id", chatId);

            if (!string.IsNullOrEmpty(parseMode))
            {
                request.AddQueryParameter("parse_mode", parseMode);
            }

            if (disableWebPagePreview.HasValue)
            {
                request.AddQueryParameter("disable_web_page_preview", disableWebPagePreview.Value.ToString());
            }

            if (replyToMessageId.HasValue)
            {
                request.AddQueryIntParameter("reply_to_message_id", replyToMessageId.Value);
            }

            request.AddParameter("text", text);

            if (replyMarkup != null)
            {
                request.AddParameter("reply_markup", JsonConvert.SerializeObject(replyMarkup));
            }

            return(ExecutePostRequestAsync <Message>(request));
        }
Esempio n. 3
0
        /// <summary>
        /// Use this method to send any messages. On success, the sent Message is returned.
        /// </summary>
        /// <param name="type">The <see cref="MessageType"/></param>
        /// <param name="chatId">Unique identifier for the message recipient — User or GroupChat id</param>
        /// <param name="content">The content of the message. Could be a text, photo, audio, sticker, document, video or location</param>
        /// <param name="replyToMessageId">Optimal. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optimal. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <param name="additionalParameters">Optimal. if additional Parameters could bei send i.e. "disable_web_page_preview" in for a TextMessage</param>
        /// <returns>On success, the sent Message is returned.</returns>
        private async Task <Message> SendMessage(MessageType type, int chatId, object content,
                                                 int replyToMessageId    = 0,
                                                 ReplyMarkup replyMarkup = null,
                                                 Dictionary <string, object> additionalParameters = null)
        {
            if (string.IsNullOrEmpty(type.Method))
            {
                throw new NotSupportedException();
            }

            if (additionalParameters == null)
            {
                additionalParameters = new Dictionary <string, object>();
            }

            additionalParameters.Add("chat_id", chatId);
            additionalParameters.Add("reply_markup", replyMarkup);

            if (replyToMessageId != 0)
            {
                additionalParameters.Add("reply_to_message_id", replyToMessageId);
            }

            if (!string.IsNullOrEmpty(type.ContentParameter))
            {
                additionalParameters.Add(type.ContentParameter, content);
            }

            return(await SendWebRequest <Message>(type.Method, additionalParameters).ConfigureAwait(false));
        }
        public override NameValueCollection BuildParameters()
        {
            if (Document == null || string.IsNullOrWhiteSpace(Document.FileId))
            {
                throw new FileIdNotFoundException();
            }

            var result = new NameValueCollection
            {
                { "chatId", ChatId },
                { "fileId", Document.FileId }
            };

            if (!string.IsNullOrWhiteSpace(Caption))
            {
                result.Add("caption", Caption);
            }

            if (ReplyMarkup != null)
            {
                string markup = ReplyMarkup.ToJson();
                result.Add("inlineKeyboardMarkup", markup);
            }

            return(result);
        }
Esempio n. 5
0
 /// <summary>
 /// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set
 /// </summary>
 public static Task <Ok> StopPollAsync(
     this Client client, long chatId = default, long messageId = default, ReplyMarkup replyMarkup = default)
 {
     return(client.ExecuteAsync(new StopPoll
     {
         ChatId = chatId, MessageId = messageId, ReplyMarkup = replyMarkup
     }));
 }
        public Task <Message> SendPhotoAsync(int chatId, string photo, string caption, int?replyToMessageId,
                                             ReplyMarkup replyMarkup)
        {
            var request = CreatePhotoRestRequest(chatId, caption, replyToMessageId, replyMarkup);

            request.AddMedia("photo", photo);
            return(ExecutePostRequestAsync <Message>(request));
        }
Esempio n. 7
0
 /// <summary>
 /// Edits the message content caption. Returns the edited message after the edit is completed on the server side
 /// </summary>
 public static Task <Message> EditMessageCaptionAsync(
     this Client client, long chatId = default, long messageId = default, ReplyMarkup replyMarkup = default, FormattedText caption = default)
 {
     return(client.ExecuteAsync(new EditMessageCaption
     {
         ChatId = chatId, MessageId = messageId, ReplyMarkup = replyMarkup, Caption = caption
     }));
 }
Esempio n. 8
0
 /// <summary>
 /// Edits the reply markup of an inline message sent via a bot; for bots only
 /// </summary>
 public static Task <Ok> EditInlineMessageReplyMarkupAsync(
     this Client client, string inlineMessageId = default, ReplyMarkup replyMarkup = default)
 {
     return(client.ExecuteAsync(new EditInlineMessageReplyMarkup
     {
         InlineMessageId = inlineMessageId, ReplyMarkup = replyMarkup
     }));
 }
Esempio n. 9
0
 /// <summary>
 /// Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
 /// </summary>
 public static Task <Message> EditMessageReplyMarkupAsync(
     this Client client, long chatId = default, long messageId = default, ReplyMarkup replyMarkup = default)
 {
     return(client.ExecuteAsync(new EditMessageReplyMarkup
     {
         ChatId = chatId, MessageId = messageId, ReplyMarkup = replyMarkup
     }));
 }
Esempio n. 10
0
 /// <summary>
 /// Edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can't be replaced if the message was set to self-destruct. Media can't be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side
 /// </summary>
 public static Task <Message> EditMessageMediaAsync(
     this Client client, long chatId = default, long messageId = default, ReplyMarkup replyMarkup = default, InputMessageContent inputMessageContent = default)
 {
     return(client.ExecuteAsync(new EditMessageMedia
     {
         ChatId = chatId, MessageId = messageId, ReplyMarkup = replyMarkup, InputMessageContent = inputMessageContent
     }));
 }
Esempio n. 11
0
 /// <summary>
 /// Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side
 /// </summary>
 public static Task <Message> EditMessageLiveLocationAsync(
     this Client client, long chatId = default, long messageId = default, ReplyMarkup replyMarkup = default, Location location = default, int heading = default, int proximityAlertRadius = default)
 {
     return(client.ExecuteAsync(new EditMessageLiveLocation
     {
         ChatId = chatId, MessageId = messageId, ReplyMarkup = replyMarkup, Location = location, Heading = heading, ProximityAlertRadius = proximityAlertRadius
     }));
 }
Esempio n. 12
0
 /// <summary>
 /// Edits the content of a live location in an inline message sent via a bot; for bots only
 /// </summary>
 public static Task <Ok> EditInlineMessageLiveLocationAsync(
     this Client client, string inlineMessageId = default, ReplyMarkup replyMarkup = default, Location location = default, int heading = default, int proximityAlertRadius = default)
 {
     return(client.ExecuteAsync(new EditInlineMessageLiveLocation
     {
         InlineMessageId = inlineMessageId, ReplyMarkup = replyMarkup, Location = location, Heading = heading, ProximityAlertRadius = proximityAlertRadius
     }));
 }
Esempio n. 13
0
 /// <summary>
 /// Edits the text of an inline text or game message sent via a bot; for bots only
 /// </summary>
 public static Task <Ok> EditInlineMessageTextAsync(
     this Client client, string inlineMessageId = default, ReplyMarkup replyMarkup = default, InputMessageContent inputMessageContent = default)
 {
     return(client.ExecuteAsync(new EditInlineMessageText
     {
         InlineMessageId = inlineMessageId, ReplyMarkup = replyMarkup, InputMessageContent = inputMessageContent
     }));
 }
Esempio n. 14
0
 /// <summary>
 /// Edits the caption of an inline message sent via a bot; for bots only
 /// </summary>
 public static Task <Ok> EditInlineMessageCaptionAsync(
     this Client client, string inlineMessageId = default, ReplyMarkup replyMarkup = default, FormattedText caption = default)
 {
     return(client.ExecuteAsync(new EditInlineMessageCaption
     {
         InlineMessageId = inlineMessageId, ReplyMarkup = replyMarkup, Caption = caption
     }));
 }
        public Task <Message> SendDocumentAsync(int chatId, string document, int?replyToMessageId,
                                                ReplyMarkup replyMarkup)
        {
            var request = CreateSendDocumentRequest(chatId, replyToMessageId, replyMarkup);

            request.AddMedia("document", document);
            return(ExecutePostRequestAsync <Message>(request));
        }
Esempio n. 16
0
        /// <summary>
        /// Use this method to send general files. On success, the sent Message is returned. Bots can send files of any type of up to 50 MB in size.
        /// </summary>
        /// <param name="chatId">Username of the target channel (in the format @channelusername)</param>
        /// <param name="documentId">File to send. You can either pass a file_id as String to resend a file that is already on the Telegram servers, or upload a new file using multipart/form-data.</param>
        /// <param name="caption">Document caption</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public Task <Message> SendDocument(string chatId, string documentId, string caption = "", int replyToMessageId = 0,
                                           ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "caption", caption }
            };

            return(SendMessage(MessageType.DocumentMessage, chatId, documentId, replyToMessageId, replyMarkup, additionalParameters));
        }
Esempio n. 17
0
        /// <summary>
        /// Use this method to send photos. On success, the sent Message is returned.
        /// </summary>
        /// <param name="chatId">Username of the target channel (in the format @channelusername)</param>
        /// <param name="photo">Photo to send. You can either pass a file_id as String to resend a photo that is already on the Telegram servers, or upload a new photo using multipart/form-data.</param>
        /// <param name="caption">Optional. Photo caption (may also be used when resending photos by file_id).</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public Task <Message> SendPhoto(string chatId, FileToSend photo, string caption = "", int replyToMessageId = 0,
                                        ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "caption", caption }
            };

            return(SendMessage(MessageType.PhotoMessage, chatId, photo, replyToMessageId, replyMarkup, additionalParameters));
        }
Esempio n. 18
0
        /// <summary>
        /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
        /// </summary>
        /// <param name="chatId">Unique identifier for the message recipient — User or GroupChat id</param>
        /// <param name="audio">Audio file to send. You can either pass a file_id as String to resend an audio that is already on the Telegram servers, or upload a new audio file using multipart/form-data.</param>
        /// <param name="duration">Duration of sent audio in seconds</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public async Task <Message> SendVoice(int chatId, string audio, int duration = 0, int replyToMessageId = 0,
                                              ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "duration", duration }
            };

            return(await SendMessage(MessageType.VideoMessage, chatId, audio, replyToMessageId, replyMarkup, additionalParameters).ConfigureAwait(false));
        }
Esempio n. 19
0
        /// <summary>
        /// Use this method to send point on the map. On success, the sent Message is returned.
        /// </summary>
        /// <param name="chatId">Unique identifier for the message recipient — User or GroupChat id</param>
        /// <param name="latitude">Latitude of location</param>
        /// <param name="longitude">Longitude of location</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public async Task <Message> SendLocation(int chatId, float latitude, float longitude, int replyToMessageId = 0,
                                                 ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "longitude", longitude },
            };

            return(await SendMessage(MessageType.LocationMessage, chatId, latitude, replyToMessageId, replyMarkup, additionalParameters).ConfigureAwait(false));
        }
Esempio n. 20
0
        /// <summary>
        /// Use this method to send photos. On success, the sent Message is returned.
        /// </summary>
        /// <param name="chatId">Unique identifier for the message recipient — User or GroupChat id</param>
        /// <param name="photo">Photo to send. You can either pass a file_id as String to resend a photo that is already on the Telegram servers, or upload a new photo using multipart/form-data.</param>
        /// <param name="caption">Optional. Photo caption (may also be used when resending photos by file_id).</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public async Task <Message> SendPhoto(int chatId, string photo, string caption = "", int replyToMessageId = 0,
                                              ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "caption", caption }
            };

            return(await SendMessage(MessageType.PhotoMessage, chatId, photo, replyToMessageId, replyMarkup, additionalParameters).ConfigureAwait(false));
        }
Esempio n. 21
0
 /// <summary>
 /// Sends a message. Returns the sent message
 /// </summary>
 public static Task <Message> SendMessageAsync(
     this Client client, long chatId         = default, long messageThreadId    = default, long replyToMessageId = default,
     MessageSendOptions options              = default, ReplyMarkup replyMarkup = default,
     InputMessageContent inputMessageContent = default)
 {
     return(client.ExecuteAsync(new SendMessage
     {
         ChatId = chatId, MessageThreadId = messageThreadId, ReplyToMessageId = replyToMessageId,
         Options = options, ReplyMarkup = replyMarkup, InputMessageContent = inputMessageContent
     }));
 }
Esempio n. 22
0
        /// <summary>
        /// Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can send video files of up to 50 MB in size.
        /// </summary>
        /// <param name="chatId">Username of the target channel (in the format @channelusername)</param>
        /// <param name="videoId">Video to send. You can either pass a file_id as String to resend a video that is already on the Telegram servers, or upload a new video file using multipart/form-data.</param>
        /// <param name="duration">Duration of sent video in seconds</param>
        /// <param name="caption">Video caption</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public Task <Message> SendVideo(string chatId, string videoId, int duration = 0, string caption = "", int replyToMessageId = 0,
                                        ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "duration", duration },
                { "caption", caption }
            };

            return(SendMessage(MessageType.VideoMessage, chatId, videoId, replyToMessageId, replyMarkup, additionalParameters));
        }
        private MediaRestRequest CreatePhotoRestRequest(int chatId, string caption, int?replyToMessageId,
                                                        ReplyMarkup replyMarkup)
        {
            var request = new MediaRestRequest(chatId, MakeRequest("sendPhoto"))
            {
                Caption          = caption,
                ReplyToMessageId = replyToMessageId,
                ReplyMarkup      = replyMarkup
            };

            return(request);
        }
Esempio n. 24
0
 /// <summary>
 /// Edits the content of a live location in an inline message sent via a bot; for bots only
 /// </summary>
 public static Task <Ok> EditInlineMessageLiveLocationAsync(this Client client,
                                                            string inlineMessageId  = default(string),
                                                            ReplyMarkup replyMarkup = default(ReplyMarkup),
                                                            Location location       = default(Location))
 {
     return(client.ExecuteAsync(new EditInlineMessageLiveLocation
     {
         InlineMessageId = inlineMessageId,
         ReplyMarkup = replyMarkup,
         Location = location,
     }));
 }
Esempio n. 25
0
        /// <summary>
        /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Document). On success, the sent Message is returned. Bots can send audio files of up to 50 MB in size.
        /// </summary>
        /// <param name="chatId">Unique identifier for the message recipient — User or GroupChat id</param>
        /// <param name="audio">Audio file to send. You can either pass a file_id as String to resend an audio that is already on the Telegram servers, or upload a new audio file using multipart/form-data.</param>
        /// <param name="duration">Duration of the audio in seconds</param>
        /// <param name="performer">Performer</param>
        /// <param name="title">Track name</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public async Task <Message> SendAudio(int chatId, string audio, int duration, string performer, string title, int replyToMessageId = 0,
                                              ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "duration", duration },
                { "performer", performer },
                { "title", title }
            };

            return(await SendMessage(MessageType.AudioMessage, chatId, audio, replyToMessageId, replyMarkup, additionalParameters).ConfigureAwait(false));
        }
Esempio n. 26
0
        /// <summary>
        /// Use this method to send text messages. On success, the sent Message is returned.
        /// </summary>
        /// <param name="chatId">Unique identifier for the message recipient — User or GroupChat id</param>
        /// <param name="text">Text of the message to be sent</param>
        /// <param name="disableWebPagePreview">Optimal. Disables link previews for links in this message</param>
        /// <param name="replyToMessageId">Optimal. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optimal. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public async Task <Message> SendTextMessage(int chatId, string text, bool disableWebPagePreview = false, int replyToMessageId = 0,
                                                    ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>();

            if (disableWebPagePreview)
            {
                additionalParameters.Add("disable_web_page_preview", true);
            }

            return(await SendMessage(MessageType.TextMessage, chatId, text, replyToMessageId, replyMarkup, additionalParameters).ConfigureAwait(false));
        }
Esempio n. 27
0
        /// <summary>
        /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Document). On success, the sent Message is returned. Bots can send audio files of up to 50 MB in size.
        /// </summary>
        /// <param name="chatId">Username of the target channel (in the format @channelusername)</param>
        /// <param name="audioId">Audio file to send. You can either pass a file_id as String to resend an audio that is already on the Telegram servers, or upload a new audio file using multipart/form-data.</param>
        /// <param name="duration">Duration of the audio in seconds</param>
        /// <param name="performer">Performer</param>
        /// <param name="title">Track name</param>
        /// <param name="replyToMessageId">Optional. If the message is a reply, ID of the original message</param>
        /// <param name="replyMarkup">Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.</param>
        /// <returns>On success, the sent Message is returned.</returns>
        public Task <Message> SendAudio(string chatId, string audioId, int duration, string performer, string title, int replyToMessageId = 0,
                                        ReplyMarkup replyMarkup = null)
        {
            var additionalParameters = new Dictionary <string, object>
            {
                { "duration", duration },
                { "performer", performer },
                { "title", title }
            };

            return(SendMessage(MessageType.AudioMessage, chatId, audioId, replyToMessageId, replyMarkup, additionalParameters));
        }
        private MediaRestRequest CreateSendVoiceRequest(int chatId, int?duration, int?replyToMessageId,
                                                        ReplyMarkup replyMarkup)
        {
            var request = new MediaRestRequest(chatId, MakeRequest("sendVoice"))
            {
                ReplyToMessageId = replyToMessageId,
                ReplyMarkup      = replyMarkup,
                Duration         = duration
            };

            return(request);
        }
Esempio n. 29
0
 /// <summary>
 /// Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only
 /// </summary>
 public static Task <Ok> EditInlineMessageMediaAsync(this Client client,
                                                     string inlineMessageId  = default(string),
                                                     ReplyMarkup replyMarkup = default(ReplyMarkup),
                                                     InputMessageContent inputMessageContent = default(InputMessageContent))
 {
     return(client.ExecuteAsync(new EditInlineMessageMedia
     {
         InlineMessageId = inlineMessageId,
         ReplyMarkup = replyMarkup,
         InputMessageContent = inputMessageContent,
     }));
 }
        public Task <Message> SendStickerAsync(int chatId, InputFile sticker, int?replyToMessageId,
                                               ReplyMarkup replyMarkup)
        {
            var request = new MediaRestRequest(chatId, MakeRequest("sendSticker"))
            {
                ReplyToMessageId = replyToMessageId,
                ReplyMarkup      = replyMarkup
            };

            request.AddMedia("sticker", sticker);

            return(ExecutePostRequestAsync <Message>(request));
        }