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
@@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using BotFramework;
using Telegram.Bot;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
+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)
});
);
}
}
}
+1 -5
View File
@@ -1,8 +1,4 @@
using System;
using Kruzya.TelegramBot.Core;
using Kruzya.TelegramBot.Core.Data;
using Kruzya.TelegramBot.Core.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Kruzya.TelegramBot.Core;
namespace Kruzya.TelegramBot.UrlLimitations
{
@@ -3,11 +3,8 @@ 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 Telegram.Bot.Types.Enums;
namespace Kruzya.TelegramBot.UrlLimitations
{