overwriteChannelPermissions
General
overwriteChannelPermissions overwrites a channel's permissions for a user / role.
Usage
Client:overwriteChannelPermissions(<string> channelId, <string> objectId, <array> options, (string) reason)
Returns: <Channel> Channel
The array of options should have indexes of permission names, with one value of either:
- true
(enabled)
- null
(unset)
- false
(disabled)
ObjectId should be a user or role ID. If the given string is not one, the execution will return an error.
Limitations
See discordChannel PATCH.
Example
local overwriter = Client:overwriteChannelPermissions(
"574945471760695315",
"244728151693983744",
{
--enabled things
["VIEW_CHANNEL"] = true,
["SEND_MESSAGES"] = true,
["EMBED_LINKS"] = true,
["ATTACH_FILES"] = true,
--disabled things
["SEND_TTS_MESSAGES"] = false,
["MANAGE_MESSAGES"] = false,
["READ_MESSAGE_HISTORY"] = false,
["MENTION_EVERYONE"] = false
}
)
print(overwriter.permissionOverwrites["244728151693983744"] ~= nil)