txj
txj
DIAdiscord.js - Imagine an app
Created by txj on 10/2/2023 in #djs-questions
Property `getString` does not exist on valid object?
d.js version: v14.13.0 node version: v18.16.0 Just quickly porting my code to windows to make sure everything is working and I noticed my VSCode is not showing me any errors, but TypeScript thinks something is wrong, nothing has changed but here is some example code.
// COMMAND.TS EXAMPLE
// NO VSCODE ERRORS FROM LINT / PRETTIER / TYPE ERRORS
async run(interaction: ChatInputCommandInteraction<'cached'>): Promise<void> {
const tt = interaction.options.getString('option', true);
console.log(tt)
}
// COMMAND.TS EXAMPLE
// NO VSCODE ERRORS FROM LINT / PRETTIER / TYPE ERRORS
async run(interaction: ChatInputCommandInteraction<'cached'>): Promise<void> {
const tt = interaction.options.getString('option', true);
console.log(tt)
}
// CONSOLE ERROR
src/interactions/owner/Settings.ts:30:40 - error TS2339: Property 'getString' does not exist on type 'Omit<CommandInteractionOptionResolver<"cached">, "getMessage" | "getFocused">'.

30 const tt = interaction.options.getString('option', true);
// CONSOLE ERROR
src/interactions/owner/Settings.ts:30:40 - error TS2339: Property 'getString' does not exist on type 'Omit<CommandInteractionOptionResolver<"cached">, "getMessage" | "getFocused">'.

30 const tt = interaction.options.getString('option', true);
14 replies
DIAdiscord.js - Imagine an app
Created by txj on 10/13/2022 in #djs-questions
Proper way to handle Close + Lock Forum Posts
Title, I'm creating a Slash command to close/open posts inside a forum to certain roles, you enter the post and type /close or /open I would like to lock and close the posts but it appears you cannot reply to the command?
await interaction.channel.setLocked(true);
await interaction.channel.setArchived(true);

// reply here ephermally
await interaction.channel.setLocked(true);
await interaction.channel.setArchived(true);

// reply here ephermally
24 replies
DIAdiscord.js - Imagine an app
Created by txj on 9/20/2022 in #djs-questions
Keep Forum Posts Open Indefinitely
Is there a way to do this currently?
7 replies
DIAdiscord.js - Imagine an app
Created by txj on 9/16/2022 in #djs-questions
Missing cache on bot, but works from Eval
Seems interaction.member?.roles.cache does not exist for me, but I can eval it, is this related to my types being wrong? https://l.txj-dev.xyz/D7Z3Y
12 replies
DIAdiscord.js - Imagine an app
Created by txj on 9/8/2022 in #djs-questions
Properly Defining Types for Interactions
Currently migrating my bot from JS(v13) -> TS(v14.3.0) and I've run into a challenge perhaps, I am attempting to call a function and pass the Interaction<> or ChatInputCommandInteraction<CacheType> type to the parameter however it doesn't think its the correct type? Am I just blind and using the wrong type to pass?
28 replies
DIAdiscord.js - Imagine an app
Created by txj on 8/22/2022 in #djs-questions
Retrieve all server messages and filter results for bad words
I am attempting to clean a server with 60k members, however I have some questions on the API limits, is it possible to remove all listed bad words from an Array from the entire server?
11 replies