2. My class Dto :
```js
import { Param } from '@discord-nestjs/core';
import { Choice } from '@discord-nestjs/core/dist/decorators/option/choice/choice.decorator';
import { ParamType } from '@discord-nestjs/core/dist/definitions/types/param.type';
enum Nade {
FLASH = 'flash',
SMOKE = 'smoke',
MOLOTOV = 'molotov',
GRENADE = 'grenade',
}
enum Map {
DUST2 = 'dust2',
INFERNO = 'inferno',
}
export class StuffyDto {
@Param({
name: 'carte',
description: 'La carte souhaitée.',
type: ParamType.STRING,
required: true,
})
@Choice(Map)
map: Map;
@Param({
name: 'grenade',
description: 'La grenade souhaitée.',
type: ParamType.STRING,
required: true,
})
@Choice(Nade)
nade: Nade;
@Param({
name: 'atterrissage',
description: 'Le lieu d’atterrissage de la grenade.',
type: ParamType.STRING,
required: false,
})
end: string;
@Param({
name: 'depart',
description: 'Le lieu du lancement de la grenade',
type: ParamType.STRING,
required: false,
})
start: string;
}
3: I use my command in discord with this params : carte: dust2, grenade: flash.
I do a CTRL + Enter to use the bot and i have an error
I have the following error in my terminal :
[Nest] 2980 - 06/03/2023, 00:57:21 ERROR [ExceptionsHandler] this.metadataProvider.isDto is not a function
TypeError: this.metadataProvider.isDto is not a function
at SlashCommandPipe.transform (C:\wamp64\www\discord-bot-lotentick\node_modules\@discord-nestjs\common\src\pipe\slash-command\slash-command.pipe.ts:32:30)
at C:\wamp64\www\discord-bot-lotentick\node_modules\@nestjs\core\pipes\pipes-consumer.js:16:33
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Hello
Description
When i try to use my slashCommand with params, i have this error : this.metadataProvider.isDto is not a function This is exactly at the line https://github.com/fjodor-rybakov/discord-nestjs/tree/master/packages/common/src/pipe/slash-command:32 And i dont know why.
To Reproduce
@Command({ name: 'stuffy', description: 'Trouve ton stuff idéal.', }) @Injectable() export class StuffyCommand { @Handler() stuffy( @InteractionEvent(SlashCommandPipe) dto: StuffyDto, @EventParams() args: ClientEvents['interactionCreate'], ): string { console.log(dto, args);
} }
3: I use my command in discord with this params : carte: dust2, grenade: flash. I do a CTRL + Enter to use the bot and i have an error
Can you fix this bug please ?
Regards