diff --git a/Configuration/XBotServiceConfiguration.cs b/Configuration/XBotServiceConfiguration.cs index f7ad1e5..0d0966c 100644 --- a/Configuration/XBotServiceConfiguration.cs +++ b/Configuration/XBotServiceConfiguration.cs @@ -2,8 +2,29 @@ namespace xBotService.Configuration { public class XBotServiceConfiguration { + /// + /// Bot Required Token ... + /// public string Token { get; set; } + + /// + /// Base Route of Bot Api ... + /// public string BaseRoute { get; set; } - public string SendAlertRoute { get; set; } + + /// + /// Verification Code Time to Live ... + /// + public int VerificationCodeTTL { get; set; } = 300; + + /// + /// Verification Code Length ... + /// + public int VerificationCodeLength { get; set; } = 6; + + /// + /// Default Timeout ... + /// + public int DefaultClientTimeout { get; set; } = 360; } } \ No newline at end of file diff --git a/Constants/XBaleBotEndpoints.cs b/Constants/XBaleBotEndpoints.cs new file mode 100644 index 0000000..fc5e4fb --- /dev/null +++ b/Constants/XBaleBotEndpoints.cs @@ -0,0 +1,31 @@ +using xExceptions.Attributes; + +namespace xBotService.Constants +{ + public enum XBaleBotEndpoints + { + [StringValue("getMe")] + GetMe, + + [StringValue("getChat")] + GetChat, + + [StringValue("sendMessage")] + SendMessage, + + [StringValue("getUpdates")] + GetUpdates, + + [StringValue("setWebhook")] + SetWebhook, + + [StringValue("deleteWebhook")] + DeleteWebhook, + + [StringValue("answerCallbackQuery")] + AnswerCallbackQuery, + + [StringValue("editMessageReplyMarkup")] + EditMessageReplyMarkup, + } +} \ No newline at end of file diff --git a/Interfaces/IXBaleBotProvider.cs b/Interfaces/IXBaleBotProvider.cs new file mode 100644 index 0000000..e437369 --- /dev/null +++ b/Interfaces/IXBaleBotProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace xBotService.Interfaces +{ + public interface IXBaleBotProvider + { + + } +} \ No newline at end of file diff --git a/Models/XBotMessageRequest.cs b/Models/XBotMessageRequest.cs new file mode 100644 index 0000000..7a4b0c7 --- /dev/null +++ b/Models/XBotMessageRequest.cs @@ -0,0 +1,73 @@ +using System.Collections.Generic; + +namespace xBotService.Models +{ + public class XBotMessageRequest + { + public long ChatId { get; set; } + public string Text { get; set; } + public string ParseMode { get; set; } + public XBotReplyMarkup ReplyMarkup { get; set; } + } + + public class XBotReplyMarkup + { + public List> InlineKeyboard { get; set; } + } + + public class XBotInlineButton + { + public string Text { get; set; } + public string Url { get; set; } + public string CallbackData { get; set; } + } + + public class XBotMessageResponse + { + public bool Ok { get; set; } + public string Description { get; set; } + public XBotResMessage Result { get; set; } + } + + public class XBotResMessage + { + public long Date { get; set; } + public string Text { get; set; } + public long MessageId { get; set; } + public XBotResUser From { get; set; } + public XBotResChat Chat { get; set; } + } + + public class XBotResUser + { + public long Id { get; set; } + public bool IsBot { get; set; } + public string LastName { get; set; } + public string Username { get; set; } + public string FirstName { get; set; } + } + + public class XBotResChat + { + public long Id { get; set; } + public string Type { get; set; } + public string Title { get; set; } + public string Username { get; set; } + public string FirstName { get; set; } + } + + public class XBotUpdate + { + public long UpdateId { get; set; } + public XBotResMessage Message { get; set; } + public XBotCallbackQuery CallbackQuery { get; set; } + } + + public class XBotCallbackQuery + { + public string Id { get; set; } + public string Data { get; set; } + public XBotResUser From { get; set; } + public XBotResMessage Message { get; set; } + } +} \ No newline at end of file diff --git a/Providers/XBaleBotProvider.cs b/Providers/XBaleBotProvider.cs new file mode 100644 index 0000000..bdb8a44 --- /dev/null +++ b/Providers/XBaleBotProvider.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using xBotService.Interfaces; + +namespace xBotService.Providers +{ + public class XBaleBotProvider : IXBaleBotProvider + { + + } +} \ No newline at end of file