fix: dumping in PM

This commit is contained in:
2026-05-09 18:12:22 +03:00
parent ed9328a9a1
commit 250e665a85
+3 -1
View File
@@ -7,6 +7,7 @@ using Kruzya.TelegramBot.Core.Extensions;
using Kruzya.TelegramBot.Core.Service;
using System.Text.Json;
using Telegram.Bot;
using Telegram.Bot.Types.Enums;
namespace West.TelegramBot.DebugTools;
@@ -27,7 +28,8 @@ public class Handler : BotEventHandler
[Command("dump", CommandParseMode.Both)]
public async Task HandleDump()
{
if (!_userService.IsUserSuper(From) && !await Bot.IsUserAdminAsync(Chat, From))
var isChatAdmin = (Chat.Type == ChatType.Private || await Bot.IsUserAdminAsync(Chat, From));
if (!_userService.IsUserSuper(From) && !isChatAdmin)
{
return;
}