P ђ ץ ร X
P ђ ץ ร X
DIAdiscord.js - Imagine an app
Created by P ђ ץ ร X on 5/26/2024 in #djs-questions
Property 'getMessage' does not exist
Hello, I've just updated to the latest version of discord.js and I can't seem to access the getMessage option in interaction.options. is there a type checking needed that I'm not aware of?
async exec(interaction: ContextMenuCommandInteraction<CacheType>) {
const { music } = this.bot.managers;
const user = interaction.user;
const message = interaction.options.getMessage('message', true); <--- ERR
let query = message.content;
let textChannel = interaction.channel;
async exec(interaction: ContextMenuCommandInteraction<CacheType>) {
const { music } = this.bot.managers;
const user = interaction.user;
const message = interaction.options.getMessage('message', true); <--- ERR
let query = message.content;
let textChannel = interaction.channel;
I get this error with the code above:
Property 'getMessage' does not exist on type 'Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused" | "getMentionable" | "getRole" | "getUser" | "getMember" | ... 7 more ... | "getSubcommand">'.ts(2339)
Property 'getMessage' does not exist on type 'Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused" | "getMentionable" | "getRole" | "getUser" | "getMember" | ... 7 more ... | "getSubcommand">'.ts(2339)
package.json "typescript": "^5.4.2" "discord.js": "^14.15.2" Thanks in adv!
5 replies