U
U
DIAdiscord.js - Imagine a bot
Created by U on 1/31/2024 in #djs-questions
Autocompletion in Slash commands
I fixed it, apprently it was checking the wrong interaction name so it was checking the wrong command, thanks for the help
8 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/31/2024 in #djs-questions
Autocompletion in Slash commands
This is the command handler, it should hopefully add the command to the collection, but it dosnt seem to read autocomplete function i assume this is where the problem lays, however i'm a bit unsure why ot only imports the execute command?
module.exports = async function CMH(client, token) {
try {
return new Promise(async(OK, ERR) => {
client.commands = new D.Collection()
let RCMH_Commands = []

const commandFiles = fs.readdirSync("./Commands/");
for (const file of commandFiles) {
const command = require(`./${file}`)
if ('autocomplete' in command && 'data' in command || 'data' in command && 'execute' in command) {
console.log(`[INFO] Importing Command: ${file}.js`)
client.commands.set(command.data.name, command);
RCMH_Commands.push(command.data.toJSON())
} else {
console.log(`[WARNING] The command ./Commands/${file} is missing a required "data" or "execute" property.`);
}
}
await RCMH(RCMH_Commands, token)
OK(client.commands)
})
} catch (e) {
console.log(`Error in Command handler ${e} Terminating program`)
process.exit()
}

}
module.exports = async function CMH(client, token) {
try {
return new Promise(async(OK, ERR) => {
client.commands = new D.Collection()
let RCMH_Commands = []

const commandFiles = fs.readdirSync("./Commands/");
for (const file of commandFiles) {
const command = require(`./${file}`)
if ('autocomplete' in command && 'data' in command || 'data' in command && 'execute' in command) {
console.log(`[INFO] Importing Command: ${file}.js`)
client.commands.set(command.data.name, command);
RCMH_Commands.push(command.data.toJSON())
} else {
console.log(`[WARNING] The command ./Commands/${file} is missing a required "data" or "execute" property.`);
}
}
await RCMH(RCMH_Commands, token)
OK(client.commands)
})
} catch (e) {
console.log(`Error in Command handler ${e} Terminating program`)
process.exit()
}

}
8 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/31/2024 in #djs-questions
Autocompletion in Slash commands
Now i just get "command.autocomplete is not a function" any tips there aswell?
8 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/28/2024 in #djs-questions
Error with choices in slash commands
Ah, guess i didnt read it. Thanks
7 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/28/2024 in #djs-questions
Error with choices in slash commands
Huh, i had no idea. Thanks wish the discord.js guides showed that.
7 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/28/2024 in #djs-questions
Help registering Slash commands
Huh, 40 mins and i did not see that... Thanks alot!
4 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/25/2023 in #djs-questions
Trying to send buttons with embed
Ahh my bad i didnt read the docs fully. Thanks for the help it works now
4 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/12/2023 in #djs-questions
Receive DM from user to Bot
i had written it wrong
5 replies
DIAdiscord.js - Imagine a bot
Created by U on 1/12/2023 in #djs-questions
Receive DM from user to Bot
Yup thanks for the help, apprently it was the partials that was wrong. my appologies
5 replies