[debug-tools] Allow chat admins to use the /dump command.

This commit is contained in:
West14
2022-03-17 18:54:07 +02:00
parent cd518131af
commit 6b49ecb4d9
+2 -1
View File
@@ -1,6 +1,7 @@
using BotFramework;
using BotFramework.Attributes;
using BotFramework.Enums;
using Kruzya.TelegramBot.Core.Extensions;
using Kruzya.TelegramBot.Core.Service;
using Newtonsoft.Json;
using Telegram.Bot;
@@ -20,7 +21,7 @@ public class Handler : BotEventHandler
[Command(InChat.All, "dump", CommandParseMode.Both)]
public async Task HandleDump()
{
if (!_userService.IsUserSuper(From))
if (!_userService.IsUserSuper(From) && !await Bot.IsUserAdminAsync(Chat, From))
{
return;
}