StickerInfo.cs 871 B

12345678910111213141516171819202122232425
  1. using System.Threading.Tasks;
  2. using CardCollector.Controllers;
  3. using CardCollector.DataBase.Entity;
  4. using CardCollector.DataBase.EntityDao;
  5. using CardCollector.Resources;
  6. using Telegram.Bot.Types;
  7. namespace CardCollector.Commands.ChosenInlineResult
  8. {
  9. public class StickerInfo : ChosenInlineResultCommand
  10. {
  11. protected override string CommandText => Command.sticker_info;
  12. public override async Task Execute()
  13. {
  14. var hash = InlineResult.Split('=')[1];
  15. var sticker = await StickerDao.GetByHash(hash);
  16. await MessageController.SendSticker(User, sticker.Id);
  17. await MessageController.SendMessage(User, sticker.ToString(), Keyboard.StickerInfoKeyboard);
  18. }
  19. public StickerInfo() { }
  20. public StickerInfo(UserEntity user, Update update) : base(user, update) { }
  21. }
  22. }