mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-03-31 13:53:42 +03:00
fix(): module work restored
This commit is contained in:
parent
2df4ddfee4
commit
63fe457b58
@ -5,7 +5,7 @@ import { UPDATE_LISTENER_METADATA } from '../telegraf.constants';
|
|||||||
import { ListenerMetadata } from '../interfaces';
|
import { ListenerMetadata } from '../interfaces';
|
||||||
|
|
||||||
export function createUpdateListenerDecorator<Method extends UpdateMethods>(
|
export function createUpdateListenerDecorator<Method extends UpdateMethods>(
|
||||||
method: Method,
|
method: unknown,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
...args: ComposerMethodArgs<Composer<never>, Method>
|
...args: ComposerMethodArgs<Composer<never>, Method>
|
||||||
|
@ -7,7 +7,9 @@ export const TelegrafProvider = {
|
|||||||
provide: Telegraf,
|
provide: Telegraf,
|
||||||
useFactory: (options: TelegrafModuleOptions) => {
|
useFactory: (options: TelegrafModuleOptions) => {
|
||||||
const telegraf = new Telegraf(options.token, options.options);
|
const telegraf = new Telegraf(options.token, options.options);
|
||||||
telegraf.use(...options.middlewares);
|
if (options.middlewares?.length > 0) {
|
||||||
|
telegraf.use(...options.middlewares);
|
||||||
|
}
|
||||||
return telegraf;
|
return telegraf;
|
||||||
},
|
},
|
||||||
inject: [TELEGRAF_MODULE_OPTIONS],
|
inject: [TELEGRAF_MODULE_OPTIONS],
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { SceneContext, Telegraf } from 'telegraf';
|
import { Telegraf } from 'telegraf';
|
||||||
import { Command, Help, InjectBot, On, Start, Update } from '../lib';
|
import { Command, Help, InjectBot, On, Start, Update } from '../lib';
|
||||||
import { EchoService } from './echo.service';
|
import { EchoService } from './echo.service';
|
||||||
import { HELLO_SCENE_ID } from './app.constants';
|
import { HELLO_SCENE_ID } from './app.constants';
|
||||||
@ -8,7 +8,7 @@ import { Context } from './interfaces/context.interface';
|
|||||||
export class AppUpdate {
|
export class AppUpdate {
|
||||||
constructor(
|
constructor(
|
||||||
@InjectBot()
|
@InjectBot()
|
||||||
private readonly bot: Telegraf<SceneContext>,
|
private readonly bot: Telegraf<any>, // TODO: fix any
|
||||||
private readonly echoService: EchoService,
|
private readonly echoService: EchoService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user