mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Initial webhook support
This commit is contained in:
+9
-1
@@ -13,6 +13,7 @@ using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Concurrent;
|
||||
using Kruzya.TelegramBot.Core.Options;
|
||||
using Telegram.Bot.Types;
|
||||
using BotFramework.Abstractions.UpdateProvider;
|
||||
|
||||
namespace Kruzya.TelegramBot.Core;
|
||||
|
||||
@@ -49,7 +50,8 @@ public class Startup
|
||||
services.AddSingleton<IAntiFlood, MemoryAntiFloodService>();
|
||||
|
||||
services.AddSingleton<ThreadSafeRandom>();
|
||||
|
||||
services.AddSingleton<IWebhookProvider, WebhookAspNetProvider>();
|
||||
services.AddControllersWithViews();
|
||||
|
||||
services.AddSingleton<ConcurrentBag<DeleteRequest>>();
|
||||
services.AddHostedService<DeleteService>();
|
||||
@@ -64,6 +66,12 @@ public class Startup
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
|
||||
_core.Modules.Configure(app, env);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user