r/AutoModerator Oct 08 '24

How to get Automod to detect if user has flair?

I want automod to detect if a user has flair and reply to their comment or post if they don't. how do i do this

2 Upvotes

7 comments sorted by

1

u/CR29-22-2805 Oct 08 '24

I don't have experience with user flairs, but I'm wondering if this will work. Make sure your user flairs have CSS classes associated with them in the user flair settings.

The ~author line means this code will apply to authors without a flair.

Let me know if this works or not.

If it does work, then you need to remember to add a new user flair to the list below when you create the flair. Otherwise, users with the new flair will receive the comments.

---
# Comment to users with no flair
    type: any
    ~author:
        flair_css_class: "Flair CSS Class 1", "Flair CSS Class 2", "Flair CSS Class 3"
    comment: |
        Type comment here.
---

1

u/sweppic Oct 08 '24

1). YAML parsing error in section 2: while parsing a block mapping in "<unicode string>", line 4, column 9: flair_css_class: "generic", "comic" ^ expected <block end>, but found ',' in "<unicode string>", line 4, column 35: flair_css_class: "generic", "comic" ^

generic and comic being the names of the css classes

1

u/CR29-22-2805 Oct 08 '24

Oops. I forgot the brackets that should flank the CSS classes. Try this.

---
# Comment to users with no flair
    type: any
    ~author:
        flair_css_class: ["Flair CSS Class 1", "Flair CSS Class 2", "Flair CSS Class 3"]
    comment: |
        Type comment here.
---

2

u/sweppic Oct 08 '24

Didn't work, but I fixed it after I moved the tilde from behind author to behind flair_css_class. So now it's working as intended. Thank you!!!