how would i know if a certain precondition is in a command?

i didnt rly find any function/feature for checking for a precondition
const fields = commands.map((v) => {
const prefix = v.supportsMessageCommands() == v.supportsChatInputCommands() ? "" : (v.supportsMessageCommands() ? "!" : "/")
const preconditionTag = v.preconditions.entries.includes("OwnerOnly" as any) ? `(OWNER ONLY)` : "" // this always returns false (i tested it)

return {name: `${prefix}${v.name} ${preconditionTag}`, value: `${v.description}`}
})
const fields = commands.map((v) => {
const prefix = v.supportsMessageCommands() == v.supportsChatInputCommands() ? "" : (v.supportsMessageCommands() ? "!" : "/")
const preconditionTag = v.preconditions.entries.includes("OwnerOnly" as any) ? `(OWNER ONLY)` : "" // this always returns false (i tested it)

return {name: `${prefix}${v.name} ${preconditionTag}`, value: `${v.description}`}
})
Solution:
Use command.options.preconditions
Jump to solution
2 Replies
Solution
Favna
Favna6mo ago
Use command.options.preconditions
doqe
doqeOP6mo ago
thx
Want results from more Discord servers?
Add your server