Code cleanup

This commit is contained in:
Andriy
2023-07-29 15:03:45 +03:00
parent 5e4183acfa
commit a24332370d
36 changed files with 46 additions and 111 deletions
+2 -4
View File
@@ -4,8 +4,6 @@ using System.Threading.Tasks;
using BotFramework;
using BotFramework.Attributes;
using BotFramework.Enums;
using BotFramework.Setup;
using Kruzya.TelegramBot.Core.Cache;
using Kruzya.TelegramBot.Core.Data;
using Kruzya.TelegramBot.Core.Extensions;
using Microsoft.Extensions.Logging;
@@ -49,12 +47,12 @@ namespace Kruzya.TelegramBot.UrlLimitations
0 || await message.HasUnknownMention(Bot))
{
var targetChat = new ChatId(Chat.Id);
Task.WaitAll(new Task[] {
Task.WaitAll(
Bot.BanChatMemberAsync(new ChatId(Chat.Id), From.Id, DateTime.Now.AddDays(1)),
Bot.DeleteMessageAsync(targetChat, message.MessageId),
Bot.SendTextMessageAsync(targetChat,
$"Member {From.ToHtml(true)} has been banned.\n<b>Reason</b>: <pre>Spam suspicion</pre>", parseMode: ParseMode.Html)
});
);
}
}
}