mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
fix: dumping in PM
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user