CommandNotFound.cs 842 B

123456789101112131415161718192021222324252627
  1. using System.Threading.Tasks;
  2. using CardCollector.Controllers;
  3. using CardCollector.DataBase.Entity;
  4. using Telegram.Bot.Types;
  5. namespace CardCollector.Commands
  6. {
  7. /* Данный класс реализует операцию "Команда не найдена" */
  8. public class CommandNotFound : UpdateModel
  9. {
  10. protected override string CommandText => "";
  11. private readonly string _command;
  12. public override async Task Execute()
  13. {
  14. await MessageController.EditMessage(User, "Команда не найдена " + _command);
  15. }
  16. protected internal override bool IsMatches(UserEntity user, Update update) => true;
  17. public CommandNotFound(UserEntity user, Update update, string command) : base(user, update)
  18. {
  19. _command = command;
  20. }
  21. }
  22. }