pyrite123
pyrite123
DIAdiscord.js - Imagine an app
Created by pyrite123 on 3/19/2024 in #djs-questions
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.)
8 replies