fjodor-rybakov / discord-nestjs

👾 NestJS package for discord.js
MIT License
271 stars 49 forks source link

Impossible to use with nestjs-telegraf #838

Closed Simkav closed 2 years ago

Simkav commented 2 years ago

Describe the bug Usage discord-nestjs with nestjs-telegraf will throw error

Dependencies @discord-nestjs/core": "^4.1.1" discord.js": "^14.2.0" telegraf": "^4.8.6" nestjs-telegraf": "^2.6.0"

To Reproduce

  1. Register TelegrafModule with options in app module
  2. Register DiscordModule with options in app module
  3. Register any discord handler decorator like @Once('ready')
  4. See error

Expected behavior I expect it to work

Desktop

Additional context Stacktrace:

TypeError: Cannot read properties of undefined (reading 'allowEvents') gateway_1 | at /home/node/app/node_modules/@discord-nestjs/core/src/explorers/middleware/middleware.explorer.ts:44:4 gateway_1 | at Array.filter () gateway_1 | at MiddlewareExplorer. (/home/node/app/node_modules/@discord-nestjs/core/src/explorers/middleware/middleware.explorer.ts:35:25) gateway_1 | at Generator.next () gateway_1 | at /home/node/app/node_modules/@discord-nestjs/core/dist/explorers/middleware/middleware.explorer.js:17:71 gateway_1 | at new Promise () gateway_1 | at __awaiter (/home/node/app/node_modules/@discord-nestjs/core/dist/explorers/middleware/middleware.explorer.js:13:12) gateway_1 | at MiddlewareExplorer.applyMiddleware (/home/node/app/node_modules/@discord-nestjs/core/dist/explorers/middleware/middleware.explorer.js:49:16) gateway_1 | at EventExplorer. (/home/node/app/node_modules/@discord-nestjs/core/src/explorers/event/event.explorer.ts:64:43) gateway_1 | at Generator.next ()

fjodor-rybakov commented 2 years ago

Hi! Can you provide minimum reproduction repo?

fjodor-rybakov commented 2 years ago

If the problem is not solved, reopen the issue again