You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe the problem you are having in as much detail as possible:
If you try creating/editing a channel's permissionOverwrites for uncached members, the library throws TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
It should just default the overwrite type to member if a role is not resolved
Include a reproducible code sample here, if possible:
awaitguild.channels.create('cool',{permissionOverwrites: [{id: '',// include the id of an uncached member of your serverallow: ['MANAGE_CHANNELS']// this does not matter}]})// orawaitchannel.edit({permissionOverwrites: [{id: '',// include the id of an uncached member of your serverallow: ['MANAGE_CHANNELS']// this does not matter}]})
Further details:
discord.js version: 12.5.3
Node.js version: 14.16.0
Operating system: Ubuntu 20.04
Priority this issue should have – please be realistic and elaborate if possible: medium
I have also tested the issue on latest master, commit hash: e848d25c86fcd4a11a7879f7dcd55d0bc93faa6d
The text was updated successfully, but these errors were encountered:
The lib has to send type of the ovewrite to the API and thus it cannot default to anything arbitrarily. It tries to get this type by resolving the provided id, which isn't possible in case the structure that id belongs to isn't cached. This can be fixed by manually providing the type of the overwrite along with fields you have above, this will bypass the resolution of type part and thus no error will be thrown. The same technique is used in #5489 to fix a similiar problem.
Please describe the problem you are having in as much detail as possible:
If you try creating/editing a channel's permissionOverwrites for uncached members, the library throws
TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
The problem is here:
discord.js/src/structures/PermissionOverwrites.js
Line 186 in 63ff6a0
It should just default the overwrite type to
member
if a role is not resolvedInclude a reproducible code sample here, if possible:
Further details:
discord.js version: 12.5.3
Node.js version: 14.16.0
Operating system: Ubuntu 20.04
Priority this issue should have – please be realistic and elaborate if possible: medium
I have also tested the issue on latest master, commit hash:
e848d25c86fcd4a11a7879f7dcd55d0bc93faa6d
The text was updated successfully, but these errors were encountered: