diff --git a/modules/ContentStore/ContentStore.cs b/modules/ContentStore/ContentStore.cs index 9522d0b..b7a1345 100644 --- a/modules/ContentStore/ContentStore.cs +++ b/modules/ContentStore/ContentStore.cs @@ -1,8 +1,6 @@ -using System.Reflection; -using Kruzya.TelegramBot.Core; +using Kruzya.TelegramBot.Core; using Microsoft.Extensions.DependencyInjection; using West.TelegramBot.ContentStore.Service; -using Module = Kruzya.TelegramBot.Core.Module; namespace West.TelegramBot.ContentStore; diff --git a/modules/ContentStore/Handler/Store.cs b/modules/ContentStore/Handler/Store.cs index 9b65e90..3dd7d85 100644 --- a/modules/ContentStore/Handler/Store.cs +++ b/modules/ContentStore/Handler/Store.cs @@ -10,7 +10,6 @@ using Telegram.Bot; using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.InputFiles; using Telegram.Bot.Types.ReplyMarkups; -using West.TelegramBot.ContentStore.Model; using West.TelegramBot.ContentStore.Service; namespace West.TelegramBot.ContentStore.Handler; @@ -31,6 +30,11 @@ public class Store : BotEventHandler [Command(InChat.Public, "store", CommandParseMode.Both)] public async Task HandleStore() { + if (From.IsBot) + { + return; + } + if (_reputation == null) { await Bot.SendTextMessageAsync(Chat.Id, "Reputation is unavailable."); @@ -85,7 +89,7 @@ public class Store : BotEventHandler return; } - var storeItem = mediaService.StoreItem; + var storeItem = mediaService!.StoreItem; var messageId = query.Message!.MessageId; var reputation = await _reputation.GetUserReputationAsync(Chat, From); if (reputation < storeItem.Price)