#Create tag for forum channels
43 messages · Page 1 of 1 (latest)
{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
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.
wrap { name: x.name } in (), because it will think its a block instead of an object and give you a syntax error
it would be a syntax error, name: x.name is not valid code outside of an object
label
do this
^
a bit out of scope of this discussion, you should probably google that to avoid clutter
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
you didn't do any of the 3 things we said
a key part of learning is reading, you should probably do that
you cant put letters into your code using a code editor?
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
even if you are using eval (which you shouldnt), you can still change what you input
so thats besides the point
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.
thats api spam lol, why not just send one message
besides you'd just be sending numbers
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
^
i've been using js for 4 years, this is not how you learn a language
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
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