Skip to content

Commit

Permalink
fix: 🐛 missing channel prop in command data options
Browse files Browse the repository at this point in the history
  • Loading branch information
liy77 committed Feb 4, 2024
1 parent f65c815 commit a04559b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/darkcord/src/resources/Interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,16 @@ export class CommandInteractionOptions {
return r?.type === ApplicationCommandOptionType.Role ? r.value : null;
}

/**
* Get a channel option value
* @param name Option name
* @returns
*/
channel(name: string) {
const r = this.get(name);
return r?.type === ApplicationCommandOptionType.Channel ? r.value : null;
}

/**
* Get a mentionable (user, member, role, channel) option value
* @param name Option name
Expand Down

0 comments on commit a04559b

Please sign in to comment.