#(joe) detecting if a message contains an emoji

89 messages Β· Page 1 of 1 (latest)

gritty dawn
#

is it possible? trying to make an emoji only channel SMILERS

astral glacierBOT
#

(joe) detecting if a message contains an emoji

astral glacierBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

sonic coral
gritty dawn
#

doesn't work

#

.contains doesn't capture emojis

sonic coral
#

!vague

vapid fieldBOT
# sonic coral !vague
Info: vague

Your question is too vague to be able to answer well.

If you're asking how to do something, please make sure to add some background detail. Make sure to specify your overall end goal and the general design/idea and any existing progress towards that goal, not just the single specific point.

For script-related problems, see also !info haste debug. For non-scripting server trouble, see !logs.

See also !xyproblem

sonic coral
#

!info haste debug

vapid fieldBOT
#
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

sonic coral
#

happy to help you with this but we also will not write the script for you etc

#

you gotta provide more detail

#

what do you need from the community

gritty dawn
#

i need a way to detect whether or not a discord message received by denizen contains an emoji or not. i've tried the following: https://paste.denizenscript.com/View/107339

but that isn't detected as an emoji in the console:
https://paste.denizenscript.com/View/107340

sonic coral
#

are you using the script editor

gritty dawn
#

yes

#

spacing is off because its in a world event thing

sonic coral
#

screenshot for me

gritty dawn
sonic coral
#

whole window

#

oh actually nvm it probably isn't parsing properly but

#

fyi

#

@fading rock <element[lol].contains_any_text[:]>

fading rockBOT
sonic coral
#

Had error: Unfilled or unrecognized sub-tag(s) 'a' for tag <a>!

#

if you test your inputs you will get useful error messages

#

in this case I'm not sure what's breaking

#

but look here

#

@fading rock <element[lol].contains[:]>

fading rockBOT
sonic coral
#

Had error: Using deprecated form of tag 'contains_text': 'contains'.

gritty dawn
#

mkay so

#

how would i go about having it detect emojis?

sonic coral
#

have you started by narrating the output of the thing you're trying to use so you can see what it looks like

gritty dawn
#

yeah

#

it sends an emoji into console

sonic coral
#

into... the debug output?

gritty dawn
#

here i'll send a debug output with that one sec

sonic coral
#

first of all, that is fascinating

#

second I thought you were talking about like custom emoji

gritty dawn
#

oh lol

#

yeah uh im not really sure why it doesn't detect the : in the message but it is what it is

sonic coral
#

can you narrate without the .text

gritty dawn
#

@fading rock <element[πŸ˜‚].contains[:]>

fading rockBOT
gritty dawn
#

sorry for ping whops

#

lemme grab the debug rq

sonic coral
#

ah

#

anyway I think you need to use regex

#

the custom emoji parsing is a different issue but I've run that up the chain

#

have fun with that

gritty dawn
#

rip

#

alright will play around with it

gritty dawn
#

is there a way to escape/not have denizen flag curly braces {} and code brackets <>?

#

as i could use those for capturing <> (custom emojis)

sonic coral
#

!t &rb

vapid fieldBOT
sonic coral
#

er

#

actually I think this may be an xy problem

gritty dawn
#

nvm got it

obsidian stream
#

!tag matches_character_set

vapid fieldBOT
# obsidian stream !tag matches_character_set

Returns true if the element contains only symbols from the given character set.
The character set is expected to be ASCII only.
This tag is case-sensitive.
For example:
"alphabet" .matches_character_set[abcdefghijklmnopqrstuvwxyz]> returns "true",
"Alphabet" .matches_character_set[abcdefghijklmnopqrstuvwxyz]> returns "false" because it has a capital "A",
and "alphabet1" .matches_character_set[abcdefghijklmnopqrstuvwxyz]> returns "false" because it has a "1".

Group

element checking

Returns

ElementTag(Boolean)

obsidian stream
#

you can check if an element doesn't contain the standard typable characters as a close match to determining if someone is using an actual standard emoji, like πŸ•πŸ”πŸŸπŸŒ­πŸΏπŸ§‚πŸ§ˆπŸ₯žπŸ§‡πŸ§‡πŸ³πŸ₯šπŸ₯“πŸžπŸ₯πŸ₯¨πŸ₯―

#

!tag elementtag.contains_text

vapid fieldBOT
obsidian stream
#

you can also check if the message contains both <&lt><&co> / <&lt>a<&co> and <&co><&gt>

#

also if you meant curly braces for some reason i didnt understand, it's &lc and &rc

#

!tag &lc

vapid fieldBOT
meager garden
#

Wait, can't you just use emoji_names to define what emojis do the group haves and then check if the message contains_any from that emoji_names list?

#

!t emoji_names

vapid fieldBOT
meager garden
#

Oh it might probably show only the added by a group emojis, not the whole discord list

junior zodiacBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@gritty dawn