Skip to content

Getting undefined on every update incoming #1259

@watsjustice

Description

@watsjustice

tried with webhook and withod -- the problem still remaining. Problem appears when i add the target module to the AppModule with others, since i ve created nestjs appl only with telegraf module everything worked fine

[Nest] 14780 - 01.11.2024, 02:02:54 ERROR [Telegraf: sadadaksdk888bot] TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.

`import { Global, Module } from '@nestjs/common';
import { session } from 'telegraf';
import { AppConfigModule } from 'src/config/app-config.module';
import { LoggerModule } from '../logger/logger.module';
import { DatabaseModule } from 'src/database/database.module';
import { AppConfigService } from 'src/config/app-config.service';
import { TelegrafModule } from 'nestjs-telegraf';
import { BotUpdate } from './telegram.update';
import { BotService } from './telegram.service';
import { TelegramProiders } from 'src/entities/telegram/telegram.prodivder';

@Module({
  imports: [
    AppConfigModule,
    LoggerModule,
    DatabaseModule,
    TelegrafModule.forRootAsync({
      imports: [AppConfigModule],
      inject: [AppConfigService],
      useFactory: async (configService: AppConfigService) => {
        return {
          token: 'TOKEN',
          middlewares: [session()],
          launchOptions: {
            webhook: {
              domain: 'DOMAIN',
              path: '/webhook',
            },
          },
          include: [TelegramModule],
        };
      },
    }),
  ],
  providers: [BotUpdate, BotService, ...TelegramProviders],
  exports: [BotUpdate, BotService],
})
export class TelegramModule {}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions