Emoji may not display correctly with channel names in special circumstances.

If special circumstance emoji are used in the channel name, they will not display correctly. code
client.on('messageCreate', async message => {
if (message.author.bot) return;

let text = await message.reply("🏘️")
let channelName = await message.guild.channels.create({
name: "🏘️"
})

console.log("text: " + text.content)
console.log("channelName: " + channelName.name)

});
client.on('messageCreate', async message => {
if (message.author.bot) return;

let text = await message.reply("🏘️")
let channelName = await message.guild.channels.create({
name: "🏘️"
})

console.log("text: " + text.content)
console.log("channelName: " + channelName.name)

});
result
text: 🏘️//A
channelName: 🏘//B
text: 🏘️//A
channelName: 🏘//B
A and B in Unicode, A:\uD83C\uDFD8\uFE0F B:\uD83C\uDFD8 and you can see that \uFE0F (which is said to be a variation selector) has been removed. How can I display the channel names correctly? (I am using Google Translate. Please let me know if there is anything wrong with the translation.)
4 Replies
d.js toolkit
d.js toolkit10mo 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! - Marked as resolved by OP
pyrite123
pyrite123OP10mo ago
discord.js:v14.14.1
node:20.11.0
discord.js:v14.14.1
node:20.11.0
monbrey
monbrey10mo ago
Not sure what this has to do with discord.js
pyrite123
pyrite123OP10mo ago
I'm sorry if the sentence is strange. What I want you to help me with is 🏘️← How to set this emoji to the channel name correctly. The emoji has a slightly unusual shape so far. Well, I tried to create a channel using the bot I created with djs, but the emoji in the name didn't display correctly. And this emoji was displayed properly when it was included in the channel name without going through the bot. From the above, I think this is caused by djs. Sorry, you were right. Thank you for your response.
Want results from more Discord servers?
Add your server