error

getting an error
/home/runner/rgsbro/node_modules/discord.js/src/structures/PermissionOverwrites.js:184
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
^

TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
at PermissionOverwrites.resolve (/home/runner/rgsbro/node_modules/discord.js/src/structures/PermissionOverwrites.js:184:28)
at /home/runner/rgsbro/node_modules/discord.js/src/managers/GuildChannelManager.js:157:81
at Array.map (<anonymous>)
at GuildChannelManager.create (/home/runner/rgsbro/node_modules/discord.js/src/managers/GuildChannelManager.js:157:51)
at Client.<anonymous> (/home/runner/rgsbro/index.js:106:28)
at Client.emit (node:events:523:35)
at MessageCreateAction.handle (/home/runner/rgsbro/node_modules/discord.js/src/client/actions/MessageCreate.js:26:14)
at module.exports [as MESSAGE_CREATE] (/home/runner/rgsbro/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/rgsbro/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
at WebSocketShard.onPacket (/home/runner/rgsbro/node_modules/discord.js/src/client/websocket/WebSocketShard.js:493:22) {
[Symbol(code)]: 'INVALID_TYPE'
}

Node.js v20.3.1
/home/runner/rgsbro/node_modules/discord.js/src/structures/PermissionOverwrites.js:184
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
^

TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
at PermissionOverwrites.resolve (/home/runner/rgsbro/node_modules/discord.js/src/structures/PermissionOverwrites.js:184:28)
at /home/runner/rgsbro/node_modules/discord.js/src/managers/GuildChannelManager.js:157:81
at Array.map (<anonymous>)
at GuildChannelManager.create (/home/runner/rgsbro/node_modules/discord.js/src/managers/GuildChannelManager.js:157:51)
at Client.<anonymous> (/home/runner/rgsbro/index.js:106:28)
at Client.emit (node:events:523:35)
at MessageCreateAction.handle (/home/runner/rgsbro/node_modules/discord.js/src/client/actions/MessageCreate.js:26:14)
at module.exports [as MESSAGE_CREATE] (/home/runner/rgsbro/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/rgsbro/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
at WebSocketShard.onPacket (/home/runner/rgsbro/node_modules/discord.js/src/client/websocket/WebSocketShard.js:493:22) {
[Symbol(code)]: 'INVALID_TYPE'
}

Node.js v20.3.1
[email protected] /home/runner/rgsbro └── [email protected] node js v20.3.1
22 Replies
d.js toolkit
d.js toolkit14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
-͟͟͞ 𝐒𝐏〆 spBripyalt
[email protected] /home/runner/rgsbro └── [email protected] node js v20.3.1
treble/luna
treble/luna14mo ago
show your code
d.js docs
d.js docs14mo ago
To share long code snippets, use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks or files.
treble/luna
treble/luna14mo ago
!
-͟͟͞ 𝐒𝐏〆 spBripyalt
what wdym
treble/luna
treble/luna14mo ago
read the tag
treble/luna
treble/luna14mo ago
what i'm guessing is that your cache one is failing also
treble/luna
treble/luna14mo ago
.cache.get(id) exists
treble/luna
treble/luna14mo ago
where you set permission overwrites
-͟͟͞ 𝐒𝐏〆 spBripyalt
line? how much times i see one time only
treble/luna
treble/luna14mo ago
36
-͟͟͞ 𝐒𝐏〆 spBripyalt
ok didn't understand anything
treble/luna
treble/luna14mo ago
and what do you expect me to do about that i told you what to do, use cache.get first if that doesnt work, the role id is incorrect
-͟͟͞ 𝐒𝐏〆 spBripyalt
i did role id is correct i did <@!id>
treble/luna
treble/luna14mo ago
then it definitely is incorrect thats not how you mention a role
Want results from more Discord servers?
Add your server