#(joe) detecting if a message contains an emoji
89 messages Β· Page 1 of 1 (latest)
(joe) detecting if a message contains an emoji
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>
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
!info haste debug
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
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!
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
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
Content of Denizen Script Paste #107339: Unnamed Denizen Script Paste... pasted 2023/03/13 18:30:44 UTC-07:00, Paste length: 182 characters across 4 lines, Content: on discord message received channel:787765855617286170: - if <context.new_message.contains...
Content of Server Log Paste #107340: Denizen Debug Logs From A Minecraft Server... pasted 2023/03/13 18:32:36 UTC-07:00, Paste length: 1778 characters across 25 lines, Content: Java Version: 19.0.1Up-time: 10h 1m
are you using the script editor
screenshot for me
whole window
oh actually nvm it probably isn't parsing properly but
fyi
@fading rock <element[
].contains_any_text[:]>
Tag parse results for <element[:lol:].contains_any_text[:]>: https://paste.denizenscript.com/View/107341
false
Had error: No tag-base handler for 'a'.
Had error: Tag :lol: is invalid!
Had error: Unfilled or unrecognized sub-tag(s) 'a' for tag <a>!
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[
].contains[:]>
Tag parse results for <element[:lol:].contains[:]>: https://paste.denizenscript.com/View/107342
false
Had error: No tag-base handler for 'a'.
Had error: Tag :lol: is invalid!
Had error: Unfilled or unrecognized sub-tag(s) 'a' for tag <a>!
Had error: Using deprecated form of tag 'contains_text': 'contains'.
Had error: Using deprecated form of tag 'contains_text': 'contains'.
have you started by narrating the output of the thing you're trying to use so you can see what it looks like
into... the debug output?
here i'll send a debug output with that one sec
Content of Server Log Paste #107345: Denizen Debug Logs From A Minecraft Server... pasted 2023/03/13 18:59:54 UTC-07:00, Paste length: 1478 characters across 22 lines, Content: Java Version: 19.0.1Up-time: 10h 29m
first of all, that is fascinating
second I thought you were talking about like custom emoji
oh lol
yeah uh im not really sure why it doesn't detect the : in the message but it is what it is
can you narrate without the .text
@fading rock <element[π].contains[:]>
Tag parse results for <element[π].contains[:]>: https://paste.denizenscript.com/View/107346
false
Had error: Using deprecated form of tag 'contains_text': 'contains'.
narrates the discordmessagetag
sorry for ping whops
lemme grab the debug rq
Content of Server Log Paste #107347: Denizen Debug Logs From A Minecraft Server... pasted 2023/03/13 19:05:55 UTC-07:00, Paste length: 1599 characters across 22 lines, Content: Java Version: 19.0.1Up-time: 10h 35m
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
is there a way to escape/not have denizen flag curly braces {} and code brackets <>?
as i could use those for capturing <> (custom emojis)
!t &rb
!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".
element checking
ElementTag(Boolean)
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
Returns whether the element contains a specified element, case insensitive.
Can use regular expression by prefixing the element with 'regex:'.
element checking
ElementTag(Boolean)
you can also check if the message contains both <<><&co> / <<>a<&co> and <&co><>>
also if you meant curly braces for some reason i didnt understand, it's &lc and &rc
!tag &lc
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
Returns a list of emoji names in the group.
dDiscordBot
ListTag
Oh it might probably show only the added by a group emojis, not the whole discord list
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
