#Create tag for forum channels

43 messages · Page 1 of 1 (latest)

fluid solsticeBOT
#

• 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.

grand inlet
#

{name: ch.availableTags.map(x => x.name)} means you have name an array, but you need an array of objects with name being a single string
....map(x => { name: x.name }) to get that array, then spread it into your other array

#

[...array, otherElement]

#

or concat, array.concat([otherElement])

#

spread it into the array

fluid solsticeBOT
#

mdn Spread syntax (...)
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.

river thistle
#

wrap { name: x.name } in (), because it will think its a block instead of an object and give you a syntax error

grand inlet
#

ah yeah, mb

#

(although it wouldn't be a syntax error, it'd just be undefined)

river thistle
#

it would be a syntax error, name: x.name is not valid code outside of an object

river thistle
#

^

grand inlet
river thistle
#

wait huh 😄

#

whats a label

#

i've never seen that

grand inlet
#

a bit out of scope of this discussion, you should probably google that to avoid clutter

river thistle
#

ye sorry, but thanks for letting me know, will definitely look into that 👍

#

show how you wrote it

#

you didnt do what i said though

#

and didnt spread the array as well

grand inlet
#

you didn't do any of the 3 things we said

#

a key part of learning is reading, you should probably do that

river thistle
#

you cant put letters into your code using a code editor?

grand inlet
#

ok but we literally told you in plain english? we said "wrap { name: x.name } in parentheses", that's not related to javascript nor programming at all, that's just related to using files in computers

#

yikes

#

don't do that

river thistle
#

even if you are using eval (which you shouldnt), you can still change what you input

#

so thats besides the point

grand inlet
#

if you're this early to js, you shouldn't be making a bot, period.

#

go learn basics, then apply that to making a bot. don't do it the other way around. you're just hindering yourself.

river thistle
#

thats api spam lol, why not just send one message

#

besides you'd just be sending numbers

grand inlet
#

please, learn at least computer literacy, then js, then djs

#

that's not how you do it chief

#

please, stop guessing

#

just go learn js

#

for your own benefit

river thistle
#

^

grand inlet
#

i've been using js for 4 years, this is not how you learn a language

river thistle
#

i kind of learned most of js by making a bot, but i didnt even know this server existed, so i googled A LOT, this server is actually really bad for you since you will get into the bad habit of asking others how to solve your problems instead of figuring them out yourself

grand inlet
#

it's not so much the server itself, it's the help system and environment here, it lends to low-effort requests much more easily than more heavily moderated support platforms