Try to Handle Commands ...
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using xModels.Base;
|
||||
using xModels.Dtos;
|
||||
|
||||
@@ -21,10 +22,16 @@ namespace xBotService.Models.Dtos
|
||||
public virtual XPersonDto User { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Check Bot User is Verified or not ...
|
||||
/// Last Verification Code Sent ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public bool Verified { get; set; }
|
||||
public DateTime? LastVerificationSent { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verified On ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DateTime? VerifiedOn { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Bot User Id ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xBotService.Models.Entities
|
||||
@@ -14,10 +15,16 @@ namespace xBotService.Models.Entities
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Check Bot User is Verified or not ...
|
||||
/// Last Verification Code Sent ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public bool Verified { get; set; }
|
||||
public DateTime? LastVerificationSent { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verified On ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public DateTime? VerifiedOn { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Bot User Id ...
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using Newtonsoft.Json;
|
||||
using xCommons.Extensions;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace xBotService.Models
|
||||
{
|
||||
@@ -346,5 +347,165 @@ namespace xBotService.Models
|
||||
public long ReplyToMessageId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Bot Button Keyboard ...
|
||||
/// </summary>
|
||||
public class XBotKeyboardButton
|
||||
{
|
||||
[JsonProperty("text",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Text { get; set; }
|
||||
|
||||
[JsonProperty("style",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Style { get; set; }
|
||||
|
||||
[JsonProperty("request_contact",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool RequestContact { get; set; }
|
||||
|
||||
[JsonProperty("request_location",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool RequestLocation { get; set; }
|
||||
|
||||
[JsonProperty("web_app",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public XBotWebAppInfo WebApp { get; set; } = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// XBot Web App Info ...
|
||||
/// </summary>
|
||||
public class XBotWebAppInfo
|
||||
{
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Bot Copy Text Button ...
|
||||
/// </summary>
|
||||
public class XBotCopyTextButton
|
||||
{
|
||||
[StringLength(256)]
|
||||
public string Text { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An Inline Keyboard Button ...
|
||||
/// </summary>
|
||||
public class XBotInlineKeyboardButton
|
||||
{
|
||||
[JsonProperty("url",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Url { get; set; }
|
||||
|
||||
[JsonProperty("text",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Text { get; set; }
|
||||
|
||||
[JsonProperty("style",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Style { get; set; }
|
||||
|
||||
[JsonProperty("callback_data",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string CallbackData { get; set; }
|
||||
|
||||
[JsonProperty("disabled",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public object Disabled { get; set; } = null;
|
||||
|
||||
[JsonProperty("web_app",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public XBotWebAppInfo WebApp { get; set; } = null;
|
||||
|
||||
[JsonProperty("copy_text",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public XBotCopyTextButton CopyText { get; set; } = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bot Inline Keyboard ...
|
||||
/// </summary>
|
||||
public class XBotInlineKeyboardMarkup
|
||||
{
|
||||
[JsonProperty("inline_keyboard",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public IList<IList<XBotInlineKeyboardButton>> InlineKeyboard { get; set; } = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bot Reply Keyboard Markup ...
|
||||
/// </summary>
|
||||
public class XBotReplyKeyboardMarkup
|
||||
{
|
||||
[JsonProperty("keyboard",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public IList<XBotKeyboardButton> Keyboard { get; set; } = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reply Bot Keyboard Remove ...
|
||||
/// </summary>
|
||||
public class XBotReplyKeyboardRemoveMarkup
|
||||
{
|
||||
[JsonProperty("remove_keyboard",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool RemoveKeyboard { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bot Reply Markup ...
|
||||
/// </summary>
|
||||
public class XBotReplyMarkup
|
||||
{
|
||||
[JsonProperty("reply_markup",
|
||||
NullValueHandling = NullValueHandling.Ignore)]
|
||||
public IList<XBotKeyboardButton> Keyboard { get; set; } = [];
|
||||
public object ReplyMarkup { get; set; }
|
||||
|
||||
public static XBotReplyMarkup InlineKeyboardMarkup(
|
||||
XBotInlineKeyboardMarkup source
|
||||
)
|
||||
{
|
||||
//
|
||||
var result = new XBotReplyMarkup
|
||||
{
|
||||
ReplyMarkup = source
|
||||
};
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XBotReplyMarkup ReplyKeyboardMarkup(
|
||||
XBotReplyKeyboardMarkup source
|
||||
)
|
||||
{
|
||||
//
|
||||
var data = source.ToJSON();
|
||||
var result = new XBotReplyMarkup
|
||||
{
|
||||
ReplyMarkup = data
|
||||
};
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public static XBotReplyMarkup ReplyKeyboardRemoveMarkup(
|
||||
XBotReplyKeyboardRemoveMarkup source
|
||||
)
|
||||
{
|
||||
//
|
||||
var data = source.ToJSON();
|
||||
var result = new XBotReplyMarkup
|
||||
{
|
||||
ReplyMarkup = data
|
||||
};
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user