mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-03-28 20:33:44 +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';
|
||||
|
||||
export function createUpdateListenerDecorator<Method extends UpdateMethods>(
|
||||
method: Method,
|
||||
method: unknown,
|
||||
) {
|
||||
return (
|
||||
...args: ComposerMethodArgs<Composer<never>, Method>
|
||||
|
@ -7,7 +7,9 @@ export const TelegrafProvider = {
|
||||
provide: Telegraf,
|
||||
useFactory: (options: TelegrafModuleOptions) => {
|
||||
const telegraf = new Telegraf(options.token, options.options);
|
||||
telegraf.use(...options.middlewares);
|
||||
if (options.middlewares?.length > 0) {
|
||||
telegraf.use(...options.middlewares);
|
||||
}
|
||||
return telegraf;
|
||||
},
|
||||
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 { EchoService } from './echo.service';
|
||||
import { HELLO_SCENE_ID } from './app.constants';
|
||||
@ -8,7 +8,7 @@ import { Context } from './interfaces/context.interface';
|
||||
export class AppUpdate {
|
||||
constructor(
|
||||
@InjectBot()
|
||||
private readonly bot: Telegraf<SceneContext>,
|
||||
private readonly bot: Telegraf<any>, // TODO: fix any
|
||||
private readonly echoService: EchoService,
|
||||
) {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user