internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId },
                    { "text", Text },
                    { "disable_web_page_preview", DisableWebPagePreview },
                    { "reply_to_message_id", ReplyToMessageId }
                }
            };

            string parseMode = null;

            switch (ParseMode)
            {
                case ParseMode.Markdown:
                    parseMode = "Markdown";
                    break;
            }

            httpData.Parameters.Add("parse_mode", parseMode);

            ReplyMarkup?.Parse(httpData, "reply_markup");

            return httpData;
        }
 internal override void Parse(HttpData httpData, string key)
 {
     httpData.Parameters.Add(key, Json.Encode(new
     {
         force_reply = ForceReply,
         selective = Selective
     }));
 }
 internal override void Parse(HttpData httpData, string key)
 {
     httpData.Parameters.Add(key, JsonData.Serialize(new
     {
         hide_keyboard = HideKeyboard,
         selective = Selective
     }));
 }
 internal override void Parse(HttpData httpData, string key)
 {
     httpData.Parameters.Add(key, Json.Encode(new
     {
         keyboard = Keyboard,
         resize_keyboard = ResizeKeyboard,
         one_time_keyboard = OneTimeKeyboard,
         selective = Selective
     }));
 }
        internal override void Parse(HttpData httpData, string key)
        {
            switch (InputFileType)
            {
                case InputFileType.String:
                    httpData.Parameters.Add(key, FileId);
                    break;

                case InputFileType.File:
                    httpData.Files.Add(key, FileExtension, File, ContentType);
                    break;
            }
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId }
                }
            };

            Action?.Parse(httpData, "action");

            return httpData;
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "url", Url }
                }
            };

            Certificate?.Parse(httpData, "certificate");

            return httpData;
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId },
                    { "reply_to_message_id", ReplyToMessageId }
                }
            };

            Document?.Parse(httpData, "document");
            ReplyMarkup?.Parse(httpData, "reply_markup");

            return httpData;
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId },
                    { "caption", Caption },
                    { "reply_to_message_id", ReplyToMessageId }
                }
            };

            Photo?.Parse(httpData, "photo");
            ReplyMarkup?.Parse(httpData, "reply_markup");

            return httpData;
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId },
                    { "latitude", Latitude },
                    { "longitude", Longitude },
                    { "reply_to_message_id", ReplyToMessageId }
                }
            };

            ReplyMarkup?.Parse(httpData, "reply_markup");

            return httpData;
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId },
                    { "duration", Duration },
                    { "reply_to_message_id", ReplyToMessageId }
                }
            };

            Voice?.Parse(httpData, "voice");
            ReplyMarkup?.Parse(httpData, "reply_markup");

            return httpData;
        }
        internal override void Parse(HttpData httpData, string key)
        {
            switch (ReplyMarkupType)
            {
                case ReplyMarkupTypes.ReplyKeyboardMarkup:
                    ReplyMarkupReplyKeyboardMarkup.Parse(httpData, key);
                    break;

                case ReplyMarkupTypes.ReplyKeyboardHide:
                    ReplyMarkupReplyKeyboardHide.Parse(httpData, key);
                    break;

                case ReplyMarkupTypes.ForceReply:
                    ReplyMarkupForceReply.Parse(httpData, key);
                    break;
            }
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "inline_query_id", InlineQueryId },
                    { "cache_time", CacheTime },
                    { "is_personal", IsPersonal },
                    { "next_offset", NextOffset }
                }
            };

            var results = Results.Select(r => ((BaseInlineQueryResultRequest)r).Parse()).ToArray();
            httpData.Parameters.Add("results", JsonData.Serialize(results));

            return httpData;
        }
예제 #14
0
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    { "chat_id", ChatId },
                    { "text", Text },
                    { "parse_mode", ParseMode.GetValue() },
                    { "disable_web_page_preview", DisableWebPagePreview },
                    { "reply_to_message_id", ReplyToMessageId }
                }
            };

            ReplyMarkup?.Parse(httpData, "reply_markup");

            return httpData;
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    {"chat_id", ChatId},
                    {"text", Text},
                    {"disable_web_page_preview", DisableWebPagePreview},
                    {"reply_to_message_id", ReplyToMessageId}
                }
            };

            if (ReplyMarkup != null)
            {
                ReplyMarkup.Parse(httpData, "reply_markup");
            }

            return httpData;
        }
예제 #16
0
        internal override void Parse(HttpData httpData, string key)
        {
            string action = null;

            switch (Action)
            {
                case Actions.Typing:
                    action = "typing";
                    break;

                case Actions.UploadPhoto:
                    action = "upload_photo";
                    break;

                case Actions.RecordVideo:
                    action = "record_video";
                    break;

                case Actions.UploadVideo:
                    action = "upload_video";
                    break;

                case Actions.RecordAudio:
                    action = "record_audio";
                    break;

                case Actions.UploadAudio:
                    action = "upload_audio";
                    break;

                case Actions.UploadDocument:
                    action = "upload_document";
                    break;

                case Actions.FindLocation:
                    action = "find_location";
                    break;
            }

            httpData.Parameters.Add(key, action);
        }
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    {"chat_id", ChatId},
                    {"reply_to_message_id", ReplyToMessageId}
                }
            };

            if (Document != null)
            {
                Document.Parse(httpData, "document");
            }
            if (ReplyMarkup != null)
            {
                ReplyMarkup.Parse(httpData, "reply_markup");
            }

            return httpData;
        }
예제 #18
0
        internal override HttpData Parse()
        {
            var httpData = new HttpData
            {
                Parameters = new HttpParameterList
                {
                    {"chat_id", ChatId},
                    {"caption", Caption},
                    {"reply_to_message_id", ReplyToMessageId}
                }
            };

            if (Photo != null)
            {
                Photo.Parse(httpData, "photo");
            }
            if (ReplyMarkup != null)
            {
                ReplyMarkup.Parse(httpData, "reply_markup");
            }

            return httpData;
        }
예제 #19
0
 internal override void Parse(HttpData httpData, string key)
 {
     httpData.Parameters.Add(key, Action.GetValue());
 }
 internal abstract void Parse(HttpData httpData, string key);