Check if a custom emoji is a valid emoji my bot can use
Hello,
I'm trying to get my bot to check it the emoji code a user enters is a valid emoji that the bot can use in a button or not but I have no idea how to do that.
Does someone have a solution?
11 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Tag suggestion for @ncls.:
• For unicode emojis (twemoji): learn more
• Custom emojis:
/<?(a)?:?(\w{2,32}):(\d{17,19})>?/
learn morecheck if it matches this regex
I think I implemented it wrong because I have no idea of RegEx. Could you take a look at this please?
I don't know if your code is wrong or not but I'd do
It works but it crashes when I put in a normal emoji or just text
Says this:
this is what I do for my bot
That works way better but still crashes when you enter
<noemoji
It's fixable with a try catch
but now I'm facing the issue that it thinks that "<😂" is a valid emojithat regex is only for custom emojis
not defaults one
Oh, I mixed things up. My function for checking normal emojis is just wrong because it just checks if a normal emoji is included. That's what passes the input. Not the custom emoji function. Thanks a lot for your help!
no prob