Skip to content

Commit

Permalink
fix(CommandHandler): list option properties explicitly in transformOp…
Browse files Browse the repository at this point in the history
…tion

* this was causing a bug in deploy.ts where JSON.stringify (from @discordjs/rest) tried to stringify the bigints from the Permissions field
  • Loading branch information
BaumianerNiklas committed Sep 20, 2021
1 parent ca4f955 commit 6cd2d9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/structures/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ export class CommandHandler {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public transformOption(option: ICommandOption): any {
return {
...option,
type: COMMAND_OPTION_TYPES[option.type],
name: option.name,
description: option.description,
required: option.required,
choices: option.choices,
options: "options" in option ? option.options?.map((o) => this.transformOption(o)) : [],
};
}
Expand Down

0 comments on commit 6cd2d9e

Please sign in to comment.