pattern in msg

This commit is contained in:
mmrbnjd
2024-09-23 13:03:53 +03:30
parent cfa6616b03
commit dadd73a8d2

View File

@@ -6,16 +6,28 @@
public servSendMsg(mpNuget.RestClient restClient) => _restClient = restClient; public servSendMsg(mpNuget.RestClient restClient) => _restClient = restClient;
//private void SendMsgByPatern(string Text, string To, int bodyID) {/*_restClient.SendByBaseNumber(Text, To, bodyID);*/ } //private void SendMsgByPatern(string Text, string To, int bodyID) {/*_restClient.SendByBaseNumber(Text, To, bodyID);*/ }
private void SendMsg(string Text, string To) => _restClient.Send(To, "50004001660045", Text, false); private void SendMsg(string Text, string To) => _restClient.Send(To, "50004001660045", Text, false);
private void SendByPattern(string[] bodys, int PatternCode, string To)
{
string text = "";
foreach (string body in bodys)
{
if (string.IsNullOrEmpty(text)) text += body.Trim();
else { text += ";" + body.Trim(); }
}
_restClient.SendByBaseNumber(text, To , PatternCode);
}
public void toContinue(string Code, string To, string title) public void toContinue(string Code, string To, string title)
{ {
SendMsg($"برای ادامه {title} از کد {Code} استفاده کنید",To); SendByPattern(new string[] { Code }, 251756, To);
// SendMsg($"برای ادامه {title} از کد {Code} استفاده کنید", To);
} }
public void SuccessfulRegistration(string to, string Username, string Password) public void SuccessfulRegistration(string To, string Username, string Password)
{ {
SendMsg("ثبت نام شما با موفقیت انجام شد" + '\n' + SendByPattern(new string[] { Username,Password }, 251815, To);
"اطلاعات کاربری:" + '\n' + //SendMsg("ثبت نام شما با موفقیت انجام شد" + '\n' +
$"نام کاربری : {Username}" + // "اطلاعات کاربری:" + '\n' +
$"کلمه عبور : {Password}" ,to); // $"نام کاربری : {Username}" +
// $"کلمه عبور : {Password}", to);
} }
//public void Authentication(string to,string code) => SendMsgByPatern(code, to, 0); //public void Authentication(string to,string code) => SendMsgByPatern(code, to, 0);
// //