mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[code-watcher] handle message edit & message delayed delete service
Message delayed deleter service deals with issue when you need to delete some message with delay without blocking the execution. This is replacement for dumb Task.Delay call. Use of it could be used before as exploit, to stop responding for a long time.
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
using Kruzya.TelegramBot.Core;
|
||||
using System.Collections.Concurrent;
|
||||
using Kruzya.TelegramBot.Core;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace West.TelegramBot.CodeWatcher
|
||||
{
|
||||
public class CodeWatcher : Module
|
||||
{
|
||||
public CodeWatcher(Core core) : base(core) {}
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<ConcurrentBag<DeleteRequest>>();
|
||||
services.AddHostedService<DeleteService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user