private async void BotClient_OnUpdate(System.Object sender, Telegram.Bot.Args.UpdateEventArgs e)
        {
            DataBase db = Singleton.GetInstance().Context;

            if (e.Update.PreCheckoutQuery != null)
            {
                await BotClient.AnswerPreCheckoutQueryAsync(e.Update.PreCheckoutQuery.Id);

                if (e.Update.PreCheckoutQuery.InvoicePayload == "Pay is correct")
                {
                    User user = db.GetUser(e.Update.PreCheckoutQuery.From.Id);
                    user.BanDate = System.DateTime.Now;
                    db.Save();
                    IsUnBan.ThisUnBan(BotClient, user);
                    await Task.Run(() => SetIncomeChannel(e.Update.PreCheckoutQuery.From.Id, e.Update.PreCheckoutQuery.TotalAmount / 100));
                }
                else if (e.Update.PreCheckoutQuery.InvoicePayload == "Balance is correct")
                {
                    AdUser adUser = db.GetAdUser(e.Update.PreCheckoutQuery.From.Id);
                    adUser.Balance += e.Update.PreCheckoutQuery.TotalAmount / 100;
                    db.Save();
                    await Task.Run(() => SetIncomeChannel(e.Update.PreCheckoutQuery.From.Id, e.Update.PreCheckoutQuery.TotalAmount / 100));
                }
                else if (e.Update.PreCheckoutQuery.InvoicePayload == "PostTemplate is correct")
                {
                    AdUser       adUser       = db.GetAdUser(e.Update.PreCheckoutQuery.From.Id);
                    PostTemplate postTemplate = db.GetTempalte(adUser.User.ID, adUser.EditingPostTemplateId);
                    postTemplate.IsPaid = true;
                    System.Object ob = await AdController.AssemblyTemplate(BotClient, postTemplate);

                    if (ob is Message)
                    {
                        Message       mes  = (Message)ob;
                        System.String text = mes.Text;
                        await BotClient.SendTextMessageAsync(CommandText.bufferChannelId, text);
                    }
                    else
                    {
                        List <InputMediaBase> inputMedias = (List <InputMediaBase>)ob;

                        await BotClient.SendMediaGroupAsync(CommandText.bufferChannelId, inputMedias);
                    }
                    IsDataTaken.IsCheck(BotClient, e.Update.PreCheckoutQuery.From.Id, postTemplate.PostTime.ToList());
                    db.Save();

                    await Task.Run(() => SetIncomeChannel(e.Update.PreCheckoutQuery.From.Id, e.Update.PreCheckoutQuery.TotalAmount / 100, postTemplate));
                }
                else if (e.Update.PreCheckoutQuery.InvoicePayload == "Pay Confirm User")
                {
                    User user = db.GetUser(e.Update.PreCheckoutQuery.From.Id);
                    user.PayConfirm = true;
                    user.PayDate    = System.DateTime.Today.AddMonths(1);
                    db.Save();

                    await Task.Run(() => SetIncomeChannel(e.Update.PreCheckoutQuery.From.Id, e.Update.PreCheckoutQuery.TotalAmount / 100));
                }
            }
        }
        private async void OnUpdate(Object sender, Telegram.Bot.Args.UpdateEventArgs e)
        {
            var db = Singleton.GetInstance().Context;

            if (e.Update.PreCheckoutQuery != null)
            {
                await BotClient.AnswerPreCheckoutQueryAsync(e.Update.PreCheckoutQuery.Id);

                if (e.Update.PreCheckoutQuery.InvoicePayload == "Pay is post")
                {
                    User user = db.LoadRecordById <User>("Users", e.Update.PreCheckoutQuery.From.Id);
                    Post post = db.LoadRecordById <Post>("Posts", user.PostId);
                    post.IsPay         = true;
                    post.IsPublication = true;

                    db.UpsertRecord("Posts", post.Id, post);

                    await Task.Run(() => BotClient.SendText(CommandName.Chat, post.PostText));
                }
            }
        }