mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[debug-tools] Allow chat admins to use the /dump command.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user