How can I add tag to discord forum using djs.

Hello I am creating forums with but I wanna add tags.
16 Replies
d.js toolkit
d.js toolkit•10mo 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!
Ninjacornix
Ninjacornix•10mo ago
like this one
No description
Ninjacornix
Ninjacornix•10mo ago
using using djs my code :
guild.channels.create({
name: line.split(',')[0].trim(),
type: 15,
}).then((ch) => {
tag.
ch.threads.create({
name: 'OPCENITO',
message: {
content: line.split(',')[1].trim(),
},
reason: "uwu autogen"
})
})
guild.channels.create({
name: line.split(',')[0].trim(),
type: 15,
}).then((ch) => {
tag.
ch.threads.create({
name: 'OPCENITO',
message: {
content: line.split(',')[1].trim(),
},
reason: "uwu autogen"
})
})
Ninjacornix
Ninjacornix•10mo ago
man this is killing me any example of it?
Kameq
Kameq•10mo ago
I believe you should use this method on forumchannel object and as a parameter, you should give an array with objects representing tags so this should work
ch.setAvailableTags([
{
name: "first tag"
},
{
name: "other tag",
emoji: {name: '😇'}
}
])
ch.setAvailableTags([
{
name: "first tag"
},
{
name: "other tag",
emoji: {name: '😇'}
}
])
MrMythical
MrMythical•10mo ago
You misspelled it btw in that example
Ninjacornix
Ninjacornix•10mo ago
yooooo thanks man it woked POGGERS
Kameq
Kameq•10mo ago
thanks, corrected Glad to hear that Documentation is so powerful, so I suggest you to learn how to use it
duck
duck•10mo ago
as a side note since this is happening at the time of channel creation, you could also just pass this array to the availableTags option of <GuildChannelManager>.create()
Kameq
Kameq•10mo ago
Yes, thats the other way. Here is the link to documentation where you can find availableTags option
Ninjacornix
Ninjacornix•10mo ago
I was trying to set tags but snowflake is required how can I get one from available tags and for some reason emoji is not working in tags
duck
duck•10mo ago
the id shouldn't be required is it that you're receiving an error? care to share your code?
Kameq
Kameq•10mo ago
<ForumChannelObj>.availableTags
<ForumChannelObj>.availableTags
if you want specified one, just make something like:
<ForumChannelObj>.availableTags.find(tag => tag.name === "some name")
<ForumChannelObj>.availableTags.find(tag => tag.name === "some name")
id snowflake shouldn't be required. If you are receiving any error, please provide it here cause I made a mistake, I fixed my exaple and now emoji should appear
duck
duck•10mo ago
I imagine they already solved the issue with the emoji here #How can I get emoji ID?
Kameq
Kameq•10mo ago
You're probably right 😅