#Channel naming
6 messages · Page 1 of 1 (latest)
• 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.
The tag can have much different characters than channels allow (remember text channels don't even allow capital letters)
Hence, most ticket bots just use the id instead
What I am doing now is:
- I create the channel name like this:
const ticketchannelname = `${interaction.user.tag}--${new Date(Date.now()).toLocaleString('hu-HU')}`; - Then use this constant as the name parameter for
guild.channels.create
Worked fine so far with my not so fancy name, didn't care about the capital letter, created the channel in all lowercases, even was able to turn the date and timestamp into the "channel name format"
eg: farleena-dani8626-2022-12-31-182742
I was just curious if some random dude with superduper extra fancy special characters in his username could make make this command error out
Well, I could use the user id, but that looks dumb as a channel name and is not so easy to read 😄
Discord will strip out any invalid characters, so you might end up with a channel name only consisting of their denominator and the datetime… that’s about it