123456789101112131415161718192021222324252627282930313233343536 |
- using System.Linq;
- using System.Threading.Tasks;
- using CardCollector.Commands.Message;
- using CardCollector.Controllers;
- using CardCollector.DataBase.Entity;
- using CardCollector.Resources;
- using CardCollector.Session.Modules;
- using Telegram.Bot.Types;
- namespace CardCollector.Commands.CallbackQuery
- {
- public class PutForAuction : CallbackQueryCommand
- {
- protected override string CommandText => Command.sell_on_auction;
- protected override bool ClearMenu => false;
- protected override bool AddToStack => false;
- public override async Task Execute()
- {
- await MessageController.AnswerCallbackQuery(User, CallbackQueryId, Messages.comission_warning, true);
- await User.ClearChat();
- var module = User.Session.GetModule<CollectionModule>();
- var priceList = (await AuctionController.GetPriceList(module.SelectedSticker.Id)).ToList();
- var lowerPrice = priceList.Count > 0 ? priceList.Min() : 0;
- var message = await MessageController.SendMessage(User,
- $"{Messages.current_price} {module.SellPrice}{Text.gem}" +
- $"\n{Messages.lower_price} {lowerPrice}{Text.gem}" +
- $"\n{Messages.enter_your_gems_price} {Text.gem}:", Keyboard.AuctionPutCancelKeyboard);
- EnterGemsPrice.AddToQueue(User.Id);
- User.Session.Messages.Add(message.MessageId);
- }
- public PutForAuction() { }
- public PutForAuction(UserEntity user, Update update) : base(user, update) { }
- }
- }
|