mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[store] disable store command for bots, cleanup
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user