fjodor-rybakov / discord-nestjs

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

Type Mismatch when using @Param Decorator with type: ParamType.USER #1151

Closed flo025 closed 9 months ago

flo025 commented 9 months ago

Is your feature request related to a problem? Please describe. Maybe related to #888 When I define a User type using the @Param decorator, it is being treated as a string instead of a User object. For example:

@Param({
  name: 'user',
  type: ParamType.USER,
})
user: User;

Describe the solution you'd like I would like the @Param decorator to correctly interpret and assign the User type, instead of treating it as a string. This will ensure that the parameter behaves as expected when used in the code, retaining all properties and methods of a User object . (@Param decorator of type Attachment correct apply type)

Describe alternatives you've considered Manually cast the string to User

fjodor-rybakov commented 9 months ago

Hi! discord js return user id string, not user object. If you need transform user id to object just write another one pipe in chain

@InteractionEvent(SlashCommandPipe, AnotherOneTransformPipe)