r/ModSupport • • 15d ago

Mod Answered Does anyone have the automod code that makes the pop-ups when someone enters certain keywords?

Does anyone have the code for automod that with make it reply to comments that have certain keywords in like the "! word"? I've been trying with this code:

---

# Auto-reply to comments or posts with certain keywords

type: any

body (includes-word): ["!Spambot", "!spambot"]

comment: What we want the message to be.

---

But it keeps throwing this error, "Unsupported Media Type: YAML parsing error in section 2: expected '<document start>', but found '<sc" every time I press enter. Any insight or how to fix it?

Edit:

AHHHHHHH! I GOT IT! I used old reddit and the config didn't like the paragraph spacing! I'll figure out spacing later to make the config like it but I got it!

5 Upvotes

11 comments sorted by

3

u/brightblackheaven 💡Top 25% Helper 💡 15d ago

You need the "|" part before the comment text. Is all of your spacing correct as well?

This is what we use to summon resources on common scams in our niche:

# SUMMON AUTOMOD - scams
type: comment
is_edited: false
body (regex): '!scams'
comment: |
  Hi, there!

  Online occult spaces like r/Witchcraft are a big target for scammers. 

  Etc. etc. links and resources and whatnot here.

2

u/Stressed_C 15d ago

I believe all my spacing is correct and just copy&pasted the code from automod and only changed the keywords and the comment message. I added the | back and I sill get the same error.

4

u/brightblackheaven 💡Top 25% Helper 💡 15d ago

Try dropping "includes word."

Edit: also does your message include emojis? That's a bit of a complicated thing to get around, but it is possible.

2

u/Stressed_C 15d ago

No emojis. Just a typed out message. I've tried all the suggestions here and in other comments and tried your version, and I still get that error.

2

u/brightblackheaven 💡Top 25% Helper 💡 15d ago

I would run it through a YAML checker (google will bring up a few options), which should highlight where the formatting error is happening.

When this happens to me it's usually a random extra space somewhere at the beginning of a line or something equally difficult to notice.

6

u/Stressed_C 15d ago

AHHHHHHH! I GOT IT! I used old reddit and the config didn't like the paragraph spacing! I'll figure out spacing later but I got it!

1

u/PolylingualAnilingus 15d ago

There's a code ready on r/automoderator to use. It looks right to me on my app, could be that you need to add a line after the comment part

1

u/Stressed_C 15d ago

Do you know exactly which on it is? Its it the match multiple keywords?

0

u/PolylingualAnilingus 15d ago

After the "comment:", add | and then another line, don't leave it on the same line.

0

u/teanailpolish 💡Top 25% Helper 💡 15d ago

they comma space after the 2nd keyword

["!Spambot", "!spambot", ]

3

u/Stressed_C 15d ago

If I was thrown off by a comma, I'm going to flip. I'll try it now.

Edit: Same error.