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:
+6
-1
@@ -2,6 +2,8 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Kruzya.TelegramBot.Core;
|
||||
|
||||
@@ -22,7 +24,10 @@ public abstract class Module
|
||||
public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public virtual Task StartAsync(CancellationToken cts, IServiceScope scope) => Task.CompletedTask;
|
||||
public virtual Task StopAsync(CancellationToken cts, IServiceScope scope) => Task.CompletedTask;
|
||||
|
||||
/// <summary>
|
||||
/// Ensures if module is loaded and started. Note that call can change module event chain.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user