adding some Models and start Bale Bot Implementation ...
This commit is contained in:
@@ -2,8 +2,29 @@ namespace xBotService.Configuration
|
||||
{
|
||||
public class XBotServiceConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Bot Required Token ...
|
||||
/// </summary>
|
||||
public string Token { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Base Route of Bot Api ...
|
||||
/// </summary>
|
||||
public string BaseRoute { get; set; }
|
||||
public string SendAlertRoute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Verification Code Time to Live ...
|
||||
/// </summary>
|
||||
public int VerificationCodeTTL { get; set; } = 300;
|
||||
|
||||
/// <summary>
|
||||
/// Verification Code Length ...
|
||||
/// </summary>
|
||||
public int VerificationCodeLength { get; set; } = 6;
|
||||
|
||||
/// <summary>
|
||||
/// Default Timeout ...
|
||||
/// </summary>
|
||||
public int DefaultClientTimeout { get; set; } = 360;
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace xBotService.Interfaces
|
||||
{
|
||||
public interface IXBaleBotProvider
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<List<XBotInlineButton>> 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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user