[cas] use file-scoped namespaces

This commit is contained in:
Andriy
2023-07-28 19:34:28 +03:00
parent c8951aad45
commit 7aed09c87c
5 changed files with 88 additions and 93 deletions
@@ -1,8 +1,8 @@
using System; using System;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Kruzya.TelegramBot.CombotAntiSpam.Combot namespace Kruzya.TelegramBot.CombotAntiSpam.Combot;
{
internal class CombotApiResponse internal class CombotApiResponse
{ {
public class ApiResult public class ApiResult
@@ -28,4 +28,3 @@ namespace Kruzya.TelegramBot.CombotAntiSpam.Combot
[JsonProperty("result")] [JsonProperty("result")]
public ApiResult Result { get; set; } public ApiResult Result { get; set; }
} }
}
@@ -4,8 +4,8 @@ using System.Threading.Tasks;
using Kruzya.TelegramBot.Core.Extensions; using Kruzya.TelegramBot.Core.Extensions;
using Telegram.Bot.Types; using Telegram.Bot.Types;
namespace Kruzya.TelegramBot.CombotAntiSpam.Combot namespace Kruzya.TelegramBot.CombotAntiSpam.Combot;
{
public class CombotClient : ICombotClient public class CombotClient : ICombotClient
{ {
public HttpClient _HttpClient; public HttpClient _HttpClient;
@@ -27,4 +27,3 @@ namespace Kruzya.TelegramBot.CombotAntiSpam.Combot
return result.IsSpammer; return result.IsSpammer;
} }
} }
}
@@ -1,11 +1,10 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Telegram.Bot.Types; using Telegram.Bot.Types;
namespace Kruzya.TelegramBot.CombotAntiSpam.Combot namespace Kruzya.TelegramBot.CombotAntiSpam.Combot;
{
public interface ICombotClient public interface ICombotClient
{ {
public bool IsSpammer(User user); public bool IsSpammer(User user);
public Task<bool> IsSpammerAsync(User user); public Task<bool> IsSpammerAsync(User user);
} }
}
+2 -3
View File
@@ -2,8 +2,8 @@
using Kruzya.TelegramBot.Core; using Kruzya.TelegramBot.Core;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Kruzya.TelegramBot.CombotAntiSpam namespace Kruzya.TelegramBot.CombotAntiSpam;
{
public class CombotAntiSpam : Module public class CombotAntiSpam : Module
{ {
public CombotAntiSpam(Core.Core core) : base(core) public CombotAntiSpam(Core.Core core) : base(core)
@@ -15,4 +15,3 @@ namespace Kruzya.TelegramBot.CombotAntiSpam
services.AddSingleton<ICombotClient, CombotClient>(); services.AddSingleton<ICombotClient, CombotClient>();
} }
} }
}
+2 -3
View File
@@ -11,8 +11,8 @@ using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
namespace Kruzya.TelegramBot.CombotAntiSpam namespace Kruzya.TelegramBot.CombotAntiSpam;
{
public class UserJoinHandler : BotEventHandler public class UserJoinHandler : BotEventHandler
{ {
protected ICombotClient _combotClient; protected ICombotClient _combotClient;
@@ -58,4 +58,3 @@ namespace Kruzya.TelegramBot.CombotAntiSpam
} }
} }
} }
}