Closed Mnigos closed 1 year ago
Describe the bug Migrate Nestjs from 10.1.3 to 10.2.1
10.1.3
10.2.1
Expected behavior Should execute method with On or Once event decorators.
On
Once
bot.gateway.ts
@Injectable() export class BotGateway { private readonly logger = new Logger(BotGateway.name) constructor(@InjectDiscordClient() private readonly client: Client) {} @Once(Events.ClientReady) onClientReady(): void { console.log('e') this.logger.log(`Logged in as ${this.client.user.tag}!`) this.client.user.setPresence({ activities: [ { type: ActivityType.Listening, name: 'Rigtch Music', }, ], }) } @On(Events.GuildMemberAdd) onGuildMemberAdd(member): void { member.roles.add( member.guild.roles.cache.find(role => role.name === 'User') ) } }
@nestjs/core
⠋ TSC Initializing type checker...[Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [NestFactory] Starting Nest application... [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] DiscoveryModule dependencies initialized +24ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] AppModule dependencies initialized +0ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] DiscordHostModule dependencies initialized +55ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] DiscordModule dependencies initialized +1ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] DiscordModule dependencies initialized +1ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [InstanceLoader] BotModule dependencies initialized +0ms [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [BotGateway] Subscribe to event(once): ready [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [BotGateway] Subscribe to event(on): guildMemberAdd [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [ApplyCommand] Subscribe to event(on): interactionCreate [Nest] 33628 - 08/24/2023, 10:29:18 AM LOG [ApplyCommand] Subscribe to event(on): interactionCreate ✔ TSC Initializing type checker... > TSC Found 0 issues.
[Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [NestFactory] Starting Nest application... [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] AppModule dependencies initialized +22ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] ConfigModule dependencies initialized +1ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] ConfigModule dependencies initialized +0ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] DiscordHostModule dependencies initialized +138ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] DiscordModule dependencies initialized +5ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] DiscordModule dependencies initialized +12ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [InstanceLoader] BotModule dependencies initialized +3ms [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [BotGateway] Subscribe to event(once): ready [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [BotGateway] Subscribe to event(on): guildMemberAdd [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [ApplyCommand] Subscribe to event(on): interactionCreate [Nest] 34824 - 08/24/2023, 10:33:13 AM LOG [ApplyCommand] Subscribe to event(on): interactionCreate e [Nest] 34824 - 08/24/2023, 10:33:14 AM LOG [BotGateway] Logged in as Rigtch BOT#1018! [Nest] 34824 - 08/24/2023, 10:33:15 AM LOG [RegisterCommandService] All guild commands removed! [Nest] 34824 - 08/24/2023, 10:33:15 AM LOG [RegisterCommandService] All guild commands are registered!
I have updated the packages. Check again, please
not it works
Having this issue myself now, @discord-nestjs/core is 5.3.11 and on @nestjs/core of 10.2.8
Describe the bug Migrate Nestjs from
10.1.3
to10.2.1
Expected behavior Should execute method with
On
orOnce
event decorators.bot.gateway.ts
Output on
@nestjs/core
version10.2.1
Output on
@nestjs/core
version10.1.3