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

409: Conflict: terminated by other getUpdates request #1238

Open
llegoelkelo opened this issue Aug 12, 2024 · 1 comment
Open

409: Conflict: terminated by other getUpdates request #1238

llegoelkelo opened this issue Aug 12, 2024 · 1 comment

Comments

@llegoelkelo
Copy link

How can you use nestjs-telegraf if your API is running horizontally on several containers at the same time?

As of now, I get the following error:

409: Conflict: terminated by other getUpdates request...
@nakamuraos
Copy link

I see this line in the source code:

if (options.launchOptions !== false) {

There is a chance that if you pass the option launchOptions: false to Factory, the bot will not launch (This is what causes this error):

import { CacheInterceptor, CacheModule, Module } from "@nestjs/common";
import { APP_INTERCEPTOR } from "@nestjs/core";
import { TelegrafModule } from "nestjs-telegraf";

@Module({
  imports: [
    CacheModule.register({ isGlobal: true }),
    TelegrafModule.forRoot({
      botName: "MY_BOT",
      token: "API_KEY",
      options: {
        handlerTimeout: 180000,
      },
+     launchOptions: false,
      include: [MyModule],
    }),
  ],
  providers: [
    { provide: APP_INTERCEPTOR, useClass: CacheInterceptor },
  ],
})
export class AppModule {}

However, the bot will not be able to listen for events from Telegram, only manually send message or call api.

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

2 participants