#rest permissions
1 messages · Page 1 of 1 (latest)
Right, but how do i select the commands that are put in via adminCommands array/
the first request returns RESTPutAPIApplicationGuildCommandsResult
type from discord-api-types btw
So this wouldnt work?
no, Routes.guildApplicationCommandsPermissions is a route builder, same as Routes.applicationGuildCommands
you need to call it with your application id and guild id
Ok so how do I make it affect only adminCommands?
by putting something of type RESTPutAPIGuildApplicationCommandsPermissionsJSONBody to this route
hmm...
so if the first one was assigned to aCommands var, I could then do aCommands.applicationGuildCommandsPermissions?
no, aCommands will be an object
hmm
right... but how am I to get the ID of the commands from this?
that would be from "aCommands" in your example
you can do that by name for example
this is using d.js methods not rest
your request body will look similar but with number types instead of "USER"
I have this, how do I do it?
how did you define permissions?
it needs to be an array of { id, permissions }
That’s the issue… can I just put permissions into the array per command?
all of those will have the same permissions, right?
Yes
if so, you can simply map aCommands to the above objects
<:_:818272565419573308> Array.prototype.map()
The map() method creates a new array populated with the results of calling a provided function on every element in the calling array.
This?
Or this?
I am not sure I did this right...
@warm lark
Would this work?
why am I doing this... only admin commands are listed as guild... I could literally just pull all guild commands and set the permissions...
This should work better right @warm lark?