Files
telegram-bot/modules/CodeWatcher/CodeWatcher.cs
T
Andriy 5471b412d9 [code-watcher] Add CodeWatcherMode option.
There are three option values:
- Disabled: module does nothing (wow).
- Remove: module removes matching messages and sends temporary message
          to instruct user what to do.
- Upload: module uploads detected code to configured Haste Server.
2023-07-28 16:53:01 +03:00

23 lines
696 B
C#

using Kruzya.TelegramBot.Core;
using Kruzya.TelegramBot.Core.Extensions;
using Microsoft.Extensions.DependencyInjection;
using West.TelegramBot.CodeWatcher.Options;
using West.TelegramBot.CodeWatcher.Service;
namespace West.TelegramBot.CodeWatcher
{
public class CodeWatcher : Module
{
public CodeWatcher(Core core) : base(core) {}
public override void ConfigureServices(IServiceCollection services)
{
services.AddOption<CodeWatcherMode>();
services.AddHttpClient<IHasteService, HasteService>(c =>
{
c.BaseAddress = new Uri(Core.Configuration["HastebinUrl"]!);
});
}
}
}