diff --git a/modules/ContentStore/Handler/Store.cs b/modules/ContentStore/Handler/Store.cs index 0467f89..c19cd56 100644 --- a/modules/ContentStore/Handler/Store.cs +++ b/modules/ContentStore/Handler/Store.cs @@ -19,13 +19,13 @@ public class Store : CommonHandler { private readonly IReputation? _reputation; private readonly IServiceProvider _provider; - private readonly ContentStore _store; - - public Store(CoreContext db, IServiceProvider provider, ContentStore store) : base(db) + private readonly UserService _userService; + + public Store(CoreContext db, IServiceProvider provider, UserService userService) : base(db) { _reputation = provider.GetService(); _provider = provider; - _store = store; + _userService = userService; } [InChat(InChat.Public)] @@ -47,6 +47,7 @@ public class Store : CommonHandler var reputation = await _reputation.GetUserReputationAsync(Chat, user); await Bot.SendMessage(Chat.Id, $"{user.ToHtml()} ({reputation}), чего пожелаете?", parseMode: ParseMode.Html, + replyParameters: Message!.Id, replyMarkup: new InlineKeyboardMarkup( _provider.GetServices() .ToAsyncEnumerable() @@ -100,11 +101,20 @@ public class Store : CommonHandler var reputation = await _reputation.GetUserReputationAsync(Chat, From); if (reputation < storeItem.Price) { - await Bot.EditMessageText( - Chat.Id, - messageId, - $"{From.ToHtml()} ({reputation}), продолжай работать и тебе обязательно хватит на покупку.", - ParseMode.Html); + if (!_userService.IsUserUnlucky(From.Id)) + { + await Bot.EditMessageText( + Chat.Id, + messageId, + $"{From.ToHtml()} ({reputation}), продолжай работать и тебе обязательно хватит на покупку.", + ParseMode.Html); + } + else + { + var inputFile = new InputFileUrl("https://unclesix-prod-static.s3.twcstorage.ru/job_application.jpg"); + await Bot.EditMessageMedia(Chat.Id, messageId, new InputMediaPhoto(inputFile)); + } + await AnswerQuery(query.Id); return; }