[cas] use http client factory

This commit is contained in:
Andriy
2023-07-28 19:41:21 +03:00
parent 7aed09c87c
commit d2e564cec6
2 changed files with 10 additions and 8 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
using Kruzya.TelegramBot.CombotAntiSpam.Combot;
using Kruzya.TelegramBot.Core;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace Kruzya.TelegramBot.CombotAntiSpam;
@@ -12,6 +13,9 @@ public class CombotAntiSpam : Module
public override void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ICombotClient, CombotClient>();
services.AddHttpClient<ICombotClient, CombotClient>(c =>
{
c.BaseAddress = new Uri("https://api.cas.chat/check");
});
}
}