Closed ERASFWGD00 closed 5 years ago
First of all: make you're on the community fork. npm install https://github.com/woor/discord.io/tarball/gateway_v6
I seem to remember making a patch so that permissions numbers work directly, not sure what's up with that.
Anyway, the right way to do it is this: bot.editChannelPermissions({channelID: "", roleID: "", deny: [Discord.Permissions.GENERAL_VIEW_CHANNEL]})
The deny
value should be an array containing multiple constants. The complete list of constants can be found here: https://github.com/Woor/discord.io/blob/master/lib/index.js#L2756
Thank you! I figured there's another issue that made the code not work (specifically, using the channel ID instead of Server ID to get the @everyone role) I'll close the issue now. Thanks for your help!
I'm trying to make it so that a channel is created and then permission overrides are set so that not everyone can see the new channel (in effect creating a new private channel)
A skimmed-down version of the code:
Where
bot
isI haven't gotten any errors from the actual 'editChannelPermissions' method, and I've tried switching 1024 for
0x00000400
as mentioned in the Discord documentation forVIEW_CHANNEL
permissions Additionally, I can't quite see how to manually do it (taking the channel object, and manually adding the overwrites), as the whole thing kind of breaks down if I try to get channel.permmisions[role_ID].allowI'm willing to give a fuller snippet of my code if it is necessary, but I've isolated the issue to the snippet provided. On a further note, I tried setting an override to a role already on the server using the same method, and though it does not work, it does create an override of sorts by adding the role to the overwritten permissions list, but with all permissions kind of at default (like shown below)
Any help would be appreciated