problem with validator

hey, is there a problem with this validator? not as in is it working, as in am i doing it correctly btw i cant defer the reply cuz maybe i will have to send an ephemeral reply in the command
import { getUserByDiscordID } from "../database/interactors/User"

/**
*
* @param {import("commandkit").ValidationProps} param0
*/
export default async function validator({ interaction, commandObj, client, handler }){
if(commandObj.options.needsAccount === undefined) return false

const account = getUserByDiscordID(interaction.user.id)

if(commandObj.options.needsAccount){
if(!account){
interaction.reply("You Dont Have An Account!")
return true
}
}else {
if(account){
interaction.reply("Yo Do Have An Account")
return true
}
}

return false
}
import { getUserByDiscordID } from "../database/interactors/User"

/**
*
* @param {import("commandkit").ValidationProps} param0
*/
export default async function validator({ interaction, commandObj, client, handler }){
if(commandObj.options.needsAccount === undefined) return false

const account = getUserByDiscordID(interaction.user.id)

if(commandObj.options.needsAccount){
if(!account){
interaction.reply("You Dont Have An Account!")
return true
}
}else {
if(account){
interaction.reply("Yo Do Have An Account")
return true
}
}

return false
}
3 Replies
d.js toolkit
d.js toolkit6mo 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! - Marked as resolved by OP
treble/luna
treble/luna6mo ago
we arent 3rd party support ask commandkit also you can perfectly defer ephemerally
Amirparsa
AmirparsaOP6mo ago
yes but we cant change from ephemeral to permanent

Did you find this page helpful?