Добавьте файлы проекта.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
using SvetoforVKBot.Models.Updates;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text.RegularExpressions;
|
||||
using VkNet;
|
||||
using VkNet.Enums.SafetyEnums;
|
||||
using VkNet.Model.Attachments;
|
||||
using VkNet.Model.Keyboard;
|
||||
using VkNet.Model.RequestParams;
|
||||
|
||||
|
||||
namespace SvetoforVKBot.Models.Commands.LK
|
||||
{
|
||||
public class SelectPersonalPlanCommand : Command
|
||||
{
|
||||
public override string Name => "{\"button\":\"selectPersonalPlan\"}";
|
||||
|
||||
public override void Execute(RootObject update, VkApi client, SvetoforVKBot.Data.SvetoforVKBotEntities db)
|
||||
{
|
||||
}
|
||||
|
||||
public override void ExecutePL(RootObject update, VkApi client, SvetoforVKBot.Data.SvetoforVKBotEntities db)
|
||||
{
|
||||
var chatId = update.@object.message.from_id;
|
||||
MessagesSendParams @params = new MessagesSendParams();
|
||||
var keyboardBuilder = new KeyboardBuilder().Clear();
|
||||
List<UserObject> users = new List<UserObject>();
|
||||
List<int> chatIds = new List<int>();
|
||||
string name = "";
|
||||
try
|
||||
{
|
||||
@params.Message = "Ваш персональный план:\n";
|
||||
|
||||
keyboardBuilder
|
||||
.AddButton("Назад", "startPL", KeyboardButtonColor.Default);
|
||||
|
||||
@params.Keyboard = keyboardBuilder.Build();
|
||||
@params.UserId = chatId;
|
||||
@params.RandomId = GetRandomId();
|
||||
client.Messages.SendAsync(@params);
|
||||
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
@params.Message = "Ошибка в SelectPersonalPlanCommand: " + ee.Message;
|
||||
@params.Attachments = null;
|
||||
@params.Keyboard = null;
|
||||
@params.UserId = 59111081;
|
||||
@params.RandomId = GetRandomId();
|
||||
client.Messages.SendAsync(@params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user