Setting emojis in a select menu
What exactly do I put in
setEmoji
? Every time I try and run the bot, it crashes with
Using 👍 as the example I've tried (and can't remember the rest):
- "thumbups"
- { name: "thumbups"}
- "<:thumbups:>"
- interaction.client.emojis.cache.get("thumbsup")
41 Replies
- 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 OPUnknown User•4mo ago
Message Not Public
Sign In & Join Server To View
It's being pulled from a database which I don't think can store the unicode.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Just as the emoji name itself. so 👍 would be stored as 'thumbsup'
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
:function: parseEmoji
@14.15.3
Parses emoji info out of a string. The string must be one of:* A UTF-8 emoji (no id)* A URL-encoded UTF-8 emoji (no id)* A Discord custom emoji (<:name:id> or <a:name:id>)k gimme a second...
Still getting invalid emoji.
does it need the colons as well or just the name?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
k 1 sec
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
sqlite
emojis come back as
thats using
console.log
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Unless there's something wrong with the emoji it's returning?
just jumped in a watch window to check what parseEmoji returns and I get this
It's not the undefined value causing the problem is it?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
yeah it's just the word.
Not sure if this'll help, but lemme grab that bit of code for you.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
The array looks like this:
["eagle", "North America", "1040332478910570582"]
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
:typealias: EmojiResolvable
@14.15.3
Data that can be resolved into a GuildEmoji object. This can be:* A Snowflake* A GuildEmoji object* A ReactionEmoji objectUnknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Yeah I found that before, just trying to figure out to how to use it in code.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
dont think sqlite supports it tbh
trying a few other things atm, bear with me
Nah it's still complaining about an invalid form body. It doesn't like that emoji for whatever reason.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
no it's failing on any emoji
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Haven't got any to test, and I can't set them on the server in question.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
one more dumb thing to try, sec
right, im confused
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
if i copy 🦅 into my code, it pastes as
:eagle:
, so... wtfUnknown User•4mo ago
Message Not Public
Sign In & Join Server To View
k, got it pasted, sec
that works, so... i have no idea
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
And there's no way to convert the plain text name to the emoji?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Someones about to get told to get a new plan or do it themselves them.
No worries.