Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting undefined on every update incoming #1259

Open
watsjustice opened this issue Oct 31, 2024 · 0 comments
Open

Getting undefined on every update incoming #1259

watsjustice opened this issue Oct 31, 2024 · 0 comments

Comments

@watsjustice
Copy link

watsjustice commented Oct 31, 2024

tried with webhook and withod -- the problem still remaining. Problem appears when i add the target module to the AppModule with others, since i create nestjs appl only with telegraf module everything works 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 {}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant