mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
add Uri parser, add ISerializationBinder
ISerializationBinder is added only in whitelist mode. Types for whitelisting should be registered manually via new API `Module.StartAsync()` or attribute `AllowedSerializableType(name)`
This commit is contained in:
@@ -14,6 +14,8 @@ using System.Collections.Concurrent;
|
||||
using Kruzya.TelegramBot.Core.Options;
|
||||
using Telegram.Bot.Types;
|
||||
using BotFramework.Abstractions.UpdateProvider;
|
||||
using System;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Kruzya.TelegramBot.Core;
|
||||
|
||||
@@ -55,11 +57,15 @@ public class Startup
|
||||
|
||||
services.AddSingleton<ConcurrentBag<DeleteRequest>>();
|
||||
services.AddHostedService<DeleteService>();
|
||||
services.AddHostedService<CoreManager>();
|
||||
|
||||
services.AddScoped<IOptionProvider, DbOptionProvider>();
|
||||
services.AddHttpClient();
|
||||
|
||||
services.AddTelegramBotParameterParser<Uri, AbsoluteUriParser>();
|
||||
|
||||
services.AddSingleton<Hash>();
|
||||
services.AddSingleton<ISerializationBinder, SerializationBinder>();
|
||||
|
||||
// Trigger module handlers.
|
||||
_core.Modules.ConfigureServices(services);
|
||||
|
||||
Reference in New Issue
Block a user