mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[cm] fix wrong behaviour when bot doesn't have perms to delete sticker
This commit is contained in:
@@ -110,6 +110,9 @@ public partial class BanStickerSet
|
||||
|
||||
[Message(InChat.Public, MessageFlag.HasSticker)]
|
||||
public async Task HandleMessage()
|
||||
{
|
||||
var message = Message!;
|
||||
if (await IsStickerBanned(message.Sticker!))
|
||||
{
|
||||
if (!await CanBotDeleteMessages())
|
||||
{
|
||||
@@ -117,9 +120,6 @@ public partial class BanStickerSet
|
||||
"Этот набор стикеров заблокирован. Чтобы я мог его удалить, выдайте мне право на удаление сообщений.");
|
||||
}
|
||||
|
||||
var message = Message!;
|
||||
if (await IsStickerBanned(message.Sticker!))
|
||||
{
|
||||
await Bot.DeleteMessageAsync(Chat.Id, message.MessageId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user