Files
Parasha/SvetoforVKBot/Models/Commands/Start/StartPLCommand.cs
2021-10-19 06:04:52 +03:00

39 lines
1.2 KiB
C#

using System;
using System.Data.SqlClient;
using SvetoforVKBot.Models.Updates;
using VkNet;
using VkNet.Model.RequestParams;
namespace SvetoforVKBot.Models.Commands
{
public class StartPLCommand : Command
{
public override string Name => "{\"button\":\"startPL\"}";
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();
try
{
StartCommand start = new StartCommand();
start.Execute(update, client, db);
}
catch (Exception ee)
{
@params.Message = "Ошибка в StartPLCommand: " + ee.Message;
@params.Attachments = null;
@params.Keyboard = null;
@params.UserId = 59111081;
@params.RandomId = GetRandomId();
client.Messages.SendAsync(@params);
}
}
}
}