TypeError [InvalidType]: Supplied parameter is not a User nor a Role.
Why am I getting this error?
6 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
Look at the title
Ofc
That was
server.channels.create({
Literally what I was about to type xD
But if I do staffs[0]
it only takes the first object in there
So what do I do instead? Spread syntax (...)
The spread (...) syntax allows an iterable, such as an array or string, to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected. In an object literal, the spread syntax enumerates the properties of an object and adds the key-value pairs to the object being created.
Not familiar with the spread syntax. Would that be
...staffs
?
Articles are not that easy to understand for everyone when English isn't their first language m8... but thanks
They aren't "explaining" the code in JS 😅
That ain't an array with objects though is it?
And I guess I wasn't really thinking straight, but no need to get rude about that 😄
I did look at it. Therefore all I needed was a "yes" 🙂