mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[code-watcher] init module.
This commit is contained in:
@@ -31,5 +31,16 @@ namespace Kruzya.TelegramBot.Core.Extensions
|
||||
|
||||
return canUse;
|
||||
}
|
||||
|
||||
public static async Task<bool> CanDeleteMessagesAsync(this ITelegramBotClient bot, Chat chat)
|
||||
{
|
||||
return await CanDeleteMessagesAsync(bot, chat, await bot.GetMeAsync());
|
||||
}
|
||||
|
||||
public static async Task<bool> CanDeleteMessagesAsync(this ITelegramBotClient bot, Chat chat, User user)
|
||||
{
|
||||
return await bot.GetChatMemberAsync(chat.Id, user.Id) is ChatMemberOwner
|
||||
or ChatMemberAdministrator {CanRestrictMembers: true};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user