mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
|
|
using System;
|
||
|
|
using BotFramework;
|
||
|
|
using Kruzya.TelegramBot.Core;
|
||
|
|
using Kruzya.TelegramBot.Core.Extensions;
|
||
|
|
using Kruzya.TelegramBot.RichSiteSummary.Data;
|
||
|
|
using Kruzya.TelegramBot.RichSiteSummary.Service;
|
||
|
|
using Microsoft.EntityFrameworkCore;
|
||
|
|
using Microsoft.Extensions.Configuration;
|
||
|
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
|
using Telegram.Bot.Types;
|
||
|
|
|
||
|
|
namespace Kruzya.TelegramBot.RichSiteSummary
|
||
|
|
{
|
||
|
|
public class Startup : Module
|
||
|
|
{
|
||
|
|
public Startup(Core.Core core) : base(core)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void ConfigureServices(IServiceCollection services)
|
||
|
|
{
|
||
|
|
services.AddDbContext<RichSiteSummaryContext>(options =>
|
||
|
|
options.UseLazyLoadingProxies()
|
||
|
|
.UseMySql(Configuration.GetConnectionString("RichSiteSummary")));
|
||
|
|
|
||
|
|
services.AddTelegramBotParameterParser<Feed, DbResolverParameter<Feed, RichSiteSummaryContext>>()
|
||
|
|
.AddTelegramBotParameterParser<Post, DbResolverParameter<Post, RichSiteSummaryContext>>()
|
||
|
|
.AddTelegramBotParameterParser<Subscriber, DbResolverParameter<Subscriber, RichSiteSummaryContext>>();
|
||
|
|
|
||
|
|
services.AddQueue<UserMessage>()
|
||
|
|
.AddQueue<UserUnsubscribe>();
|
||
|
|
|
||
|
|
services.AddHostedService<RssFetch>();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|