grammyjs / nestjs

grammY integration for NestJS.
40 stars 11 forks source link

Is middleware woking? #27

Closed stPitty closed 1 year ago

stPitty commented 1 year ago

Im using async configuration and want to use session:

createGrammyOptions(): GrammyModuleOptions {
    return {
      token: myToken,
      middlewares: [session({ initial: () => ({ pizzaCount: 0 }) })],
    };
  }
}

Use this in app.module for import:

NestjsGrammyModule.forRootAsync({
  useClass: GrammyConfigService,
}),

But its not working. I had tried create custom middleware and it still didnt work. I just catch nothing in ctx:

image
KnorpelSenf commented 1 year ago

Is this a question or a bug report? Either way, you need to elaborate what you mean by “not working.”

Morb0 commented 1 year ago

No, they're not working. For some reason, line for register middlewares from options were just deleted and now that useless field... https://github.com/grammyjs/nestjs/commit/93d8f8335b567979d0a5729d50dff07df36f0ee1#diff-cb28a0c29c88963748f1d370d740da14e5bbf732bd912ab8b34dca8a686d1acd

KnorpelSenf commented 1 year ago

@drmikecrowe and @solidprinciples who maintain this repo are both relatively inactive at the time. Feel free to fix things up and help getting this project back on track, until hopefully they return.

solidprinciples commented 1 year ago

PR #33 should fix this. One published, consuming version 0.3.3 should fix your issue.