Skip to content
Discussion options

You must be logged in to vote

a) how to get a command's ID

await guild.commands.fetch()

to fetch all the commands, afterwards you can use find to find the command via it's name
and now you have a singular specific command available to you
now just accessing command.id would give you the id
to apply that entirely it would be

const myKickCommandID = (await guild.commands.fetch()).find(command => command.name === "kick")?.id

b) how to apply "permissions" to a command

after you've gotten a singular command, it's exactly like the guide, you call .permissions.add to it read the docs for more information on this

c) how to in general use this approach

this requires you to already have commands registered and you run thi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Jiralite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants