Esempio n. 1
0
 public void Execute(Message msg, IMessageSenderService sender, IBot bot)
 {
     if (msg.Payload.Arguments[0] == "adsAdd")
     {
         AdvertisementAddCommand.AddPartOne(msg.MessageVK.FromId.Value, msg.ChatId, int.Parse(msg.Payload.Arguments[1]), sender);
     }
 }
        public void Execute(Message msg, IMessageSenderService sender, IBot bot)
        {
            if (StaticContent.UsersCommand.Any(u => u.Key == msg.MessageVK.FromId))
            {
                var command = StaticContent.UsersCommand.SingleOrDefault(u => u.Key == msg.MessageVK.FromId);
                StaticContent.UsersCommand.Remove(msg.MessageVK.FromId.Value);

                if (command.Value == "addAdsPartTwo")
                {
                    AdvertisementAddCommand.AddPartTwo(msg.MessageVK.FromId.Value, msg.ChatId, sender, msg.Text, bot);
                }
                else if (command.Value == "addcarinfo")
                {
                    AddCarCommand.AddCarInfo(sender, msg.ChatId, msg.Text);
                }
                else if (command.Value == "target")
                {
                    TargetEditCommand.Edited(msg, sender, bot);
                }
                else if (command.Value == "search")
                {
                    SearchCommand.Search(msg, sender, bot);
                }
            }
            else
            {
                sender.Text("⛔ Неизвестная команда", msg.ChatId);
            }
        }