mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 15:34:38 +03:00
refactor(services): rename module services
This commit is contained in:
parent
b67b859810
commit
ec99dcd65f
@ -1 +1 @@
|
|||||||
export * from './invalid-configuration.exeption';
|
export * from './invalid-configuration.exeption'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export * from './telegraf.module'
|
export * from './telegraf.module'
|
||||||
export * from './interfaces'
|
export * from './interfaces'
|
||||||
export * from './decorators'
|
export * from './decorators'
|
||||||
export * from './telegraf-bot.service'
|
export * from './telegraf.service'
|
||||||
export * from './telegraf-telegram-client.service'
|
export * from './telegraf-telegram.service'
|
||||||
|
@ -5,7 +5,7 @@ import { TokenInjectionToken } from './telegraf.constants'
|
|||||||
import { TelegrafOptionsFactory } from './interfaces'
|
import { TelegrafOptionsFactory } from './interfaces'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TelegrafTelegramClientService {
|
export class TelegrafTelegramService {
|
||||||
private telegram: any
|
private telegram: any
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
@ -1,11 +1,7 @@
|
|||||||
import { Module, DynamicModule, Provider } from '@nestjs/common'
|
import { Module, DynamicModule, Provider } from '@nestjs/common'
|
||||||
import { TelegrafBotService } from './telegraf-bot.service'
|
import { TelegrafModuleAsyncOptions, TelegrafOptionsFactory } from './interfaces'
|
||||||
import {
|
|
||||||
TelegrafModuleAsyncOptions,
|
|
||||||
TelegrafOptionsFactory,
|
|
||||||
} from './interfaces'
|
|
||||||
import { TELEGRAF_MODULE_OPTIONS, TokenInjectionToken } from './telegraf.constants'
|
import { TELEGRAF_MODULE_OPTIONS, TokenInjectionToken } from './telegraf.constants'
|
||||||
import { TelegrafTelegramClientService } from './telegraf-telegram-client.service'
|
import { TelegrafService, TelegrafTelegramService } from './'
|
||||||
|
|
||||||
@Module({})
|
@Module({})
|
||||||
export class TelegrafModule {
|
export class TelegrafModule {
|
||||||
@ -15,14 +11,14 @@ export class TelegrafModule {
|
|||||||
imports: options.imports || [],
|
imports: options.imports || [],
|
||||||
providers: [
|
providers: [
|
||||||
...this.createAsyncProviders(options),
|
...this.createAsyncProviders(options),
|
||||||
TelegrafBotService,
|
TelegrafService,
|
||||||
TelegrafTelegramClientService,
|
TelegrafTelegramService,
|
||||||
{
|
{
|
||||||
provide: TokenInjectionToken,
|
provide: TokenInjectionToken,
|
||||||
useClass: options.useClass,
|
useClass: options.useClass,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
exports: [TelegrafBotService, TelegrafTelegramClientService],
|
exports: [TelegrafService, TelegrafTelegramService],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ import {
|
|||||||
import { InvalidConfigurationException } from './exeptions'
|
import { InvalidConfigurationException } from './exeptions'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TelegrafBotService {
|
export class TelegrafService {
|
||||||
private readonly logger = new Logger(TelegrafBotService.name, true)
|
private readonly logger = new Logger(TelegrafService.name, true)
|
||||||
private readonly sitePublicUrl?: string
|
private readonly sitePublicUrl?: string
|
||||||
private readonly bot: Telegraf<ContextMessageUpdate>
|
private readonly bot: Telegraf<ContextMessageUpdate>
|
||||||
private ref: ModuleRef
|
private ref: ModuleRef
|
Loading…
Reference in New Issue
Block a user