Try to Handle Commands ...
This commit is contained in:
@@ -8,11 +8,12 @@ namespace xBotService.Providers.GraphQL
|
||||
public XBotUserGraphType() : base()
|
||||
{
|
||||
Field(x => x.UserId);
|
||||
Field(x => x.Verified);
|
||||
Field(x => x.BotUserId);
|
||||
Field(x => x.VerifiedOn);
|
||||
Field(x => x.BotUserName);
|
||||
Field(x => x.BotLastname);
|
||||
Field(x => x.BotFirstname);
|
||||
Field(x => x.LastVerificationSent);
|
||||
}
|
||||
}
|
||||
}
|
||||
+48
-42
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using xIdentityService.Interfaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using xExceptions.Constants;
|
||||
using System;
|
||||
|
||||
namespace xBotService.Providers
|
||||
{
|
||||
@@ -55,6 +56,9 @@ namespace xBotService.Providers
|
||||
baseUrl: configuration.BaseRoute
|
||||
);
|
||||
|
||||
//
|
||||
result.Timeout = configuration.DefaultClientTimeout;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -225,55 +229,57 @@ namespace xBotService.Providers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sending Verification Request Menu ...
|
||||
/// Show Verification Request Menu ...
|
||||
/// </summary>
|
||||
/// <param name="chatId"></param>
|
||||
/// <param name="botUserId"></param>
|
||||
/// <param name="label"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
// public virtual async Task<XBotMessageResponse> SendVerificationMenu(
|
||||
// long chatId,
|
||||
// string label = "🔐 دریافت کد وریفیکیشن",
|
||||
// CancellationToken cancellationToken = default
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// // Validate ...
|
||||
// if (chatId <= 0 || label.IsNullOrEmpty())
|
||||
// {
|
||||
// XException.InvalidArgs.Throw();
|
||||
// }
|
||||
public virtual async Task<XBotMessage> ShowVerificationMenu(
|
||||
long botUserId,
|
||||
string label = XBotMessageIds.XBotRequestVerificationCodeLabel,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
// Validate ...
|
||||
if (botUserId <= 0 || label.IsNullOrEmpty())
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
}
|
||||
|
||||
// //
|
||||
// // Markup for Keyboards ...
|
||||
// var markup = new XBotReplyMarkup
|
||||
// {
|
||||
// //
|
||||
// InlineKeyboard =
|
||||
// [
|
||||
// //
|
||||
// [
|
||||
// //
|
||||
// new XBotInlineButton
|
||||
// {
|
||||
// Text = label,
|
||||
// CallbackData = "request_verification_code"
|
||||
// }
|
||||
// ]
|
||||
// ]
|
||||
// };
|
||||
//
|
||||
// Markup for Keyboards ...
|
||||
var markup = XBotReplyMarkup
|
||||
.InlineKeyboardMarkup(new XBotInlineKeyboardMarkup
|
||||
{
|
||||
InlineKeyboard = [
|
||||
[
|
||||
new XBotInlineKeyboardButton{
|
||||
Text = label,
|
||||
CallbackData = XBotMessageIds.XBotRequestVerificationCode
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// //
|
||||
// var response = await SendMessage(
|
||||
// chatId: chatId,
|
||||
// text: "برای دریافت کد وریفیکیشن روی دکمه زیر کلیک کنید:",
|
||||
// replyMarkup: markup,
|
||||
// cancellationToken: cancellationToken
|
||||
// );
|
||||
//
|
||||
var requestModel = new XBotSendMessageRequest
|
||||
{
|
||||
ChatId = botUserId,
|
||||
ReplyMarkup = markup.ReplyMarkup,
|
||||
Text = XBotMessageIds.XBotRequestVerificationCodeMessageText,
|
||||
};
|
||||
|
||||
//
|
||||
var result = await SendMessage(
|
||||
requestModel: requestModel,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
// //
|
||||
// return response;
|
||||
// }
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send Verification Code to Requests ...
|
||||
|
||||
Reference in New Issue
Block a user