Type 'X' is not comparable to type 'APIApplicationCommandOption'.

import {
type APIApplicationCommandOption,
Message,
ApplicationCommandOptionType,
} from "discord.js";

const promptArguments = async (message: Message, options: APIApplicationCommandOption[]) => {
for (const option of options) {
switch (option) {
case ApplicationCommandOptionType.String:
break;

default:
break;
}
}
};
import {
type APIApplicationCommandOption,
Message,
ApplicationCommandOptionType,
} from "discord.js";

const promptArguments = async (message: Message, options: APIApplicationCommandOption[]) => {
for (const option of options) {
switch (option) {
case ApplicationCommandOptionType.String:
break;

default:
break;
}
}
};
5 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Lazuee
LazueeOP16mo ago
discord.js: 14.12.1 node: v18.16.1
Lazuee
LazueeOP16mo ago
Lazuee
LazueeOP16mo ago
oof,. nvm looks like it's my mistake.
Lazuee
LazueeOP16mo ago
it should be option.type not option
Want results from more Discord servers?
Add your server