-
Hey! I decided to look into giving this solution a shot after becoming growingly frustrated with the built-in automoderator, and got an operator instance set up yesterday albeit with a few hiccups(nearly all of which were user errors). Today I decided to take a stab at adding some of the rules I wanted to perform before but could not with automoderator, and have run into something that I just cannot seem to wrap my head around for some reason. My goal was to create a rule that would scan the user flair of every member making a submission/comment for certain keywords and if found, logging the incident, notifying the user via direct message, and then removing the flair. While the documentation provides information for checking against specific(complete) flairs, I cannot seem to figure out how to change this to a more flexible approach to perform actions if any of a set of strings is found anywhere within the flair. Is this possible? I feel like it probably is but I'm just doing something wrong 😭. Below is a partial snippet of what I have so far, any help would be appreciated. - name: flair filtering SUBMISSION
description: Scan user flair for hotwords, if found, reset the flair, log via modmail, and send a message to the user.
kind: submission
rules:
- name: flairfilter-sub
kind: author
flairText:
regex: '/just|testing|things/'
actions:
- kind: report
content: flag
#Not sure if the below two work, so I just commented them out for now and replaced them with something that I know does work.
# - kind: userflair
# text: nope |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
sigh figured it out, Now I'm just back to fighting with the other stuff lol. - name: flair filtering SUBMISSION
description: Scan user flair for hotwords, if found, reset the flair, log via modmail, and send a message to the user.
kind: submission
rules:
- name: flairfilter-sub
kind: author
include:
- flairText:
- just
- testing
- things
actions:
- kind: userflair
text: nope |
Beta Was this translation helpful? Give feedback.
-
Hello, me again 😔 After weeks of staring at and fiddling with this here and there, I still cannot seem to get this to work the way I want it to, is there any guidance on what I could use to achieve this functionality? Script for submissions is as follows(I have not touched much of the comment one as it just seems silly to work on that one while this one isn't even working) : runs:
#... other runs....
- name: flair-filter
checks:
- name: flair-filter-sub
description: Scan user flair for hotwords, if found, reset the flair, log via modmail, and send a message to the user.
kind: submission
authorIs:
- flairText:
- '/sub(?:missive|by|)|dom(?:inant|me|my|)/i'
- '/slut(?:t(?:y|ie(?:st|r))|s|)/i'
- '/whor(?:e(?:s|d|)|ing)/i'
- '/siss(?:y|ys|ies|ify)/i'
- '/mistress/i'
actions:
- kind: message
asSubreddit: false
content: |
The user flair of u/{{item.author}} ({{item.author}}) has been reset.
Original content: `{{Cannot determine what to put here}}`
title: 'Flair Filtering'
to: 'r/{{manager}}'
- kind: message
asSubreddit: false
footer: false
content: |
Hello, this message has been sent to inform you that your user flair in r/{{manager}} has been reset as it contains content in violation of our rules.
Before setting your flair again, please ensure you have modified it to be in accordance with our rules. Furthermore, any attempts to bypass this mechanism will result in punishment. To make this a little bit easier, the contents of your flair can be found below.
`{{Can't get it to work here either}}`
If you believe this is an error, please contact us via [Modmail](/message/compose?to=/r/{{manager}})
- kind: userflair
text: A turtle The specific areas in question where aid is necessary, contain "{{Can't get it to work here either}}" and {{Cannot determine what to put here}} Thank you again. |
Beta Was this translation helpful? Give feedback.
Glad you got it figured out! Using plain text matching
flairText
with a list is fine but if you want to use regex you only need to enclose the string in forward slashses, no need for aregex
property.Or it could be a list of regexes and regular strings
Also just fyi you can use the author filter without the need for an author rule with
authorIs
on basically any other component in CM. The author rule is helpful if you wanted to combine the author filter with a bunch of other rules in different ways, like in a rule set. But generally its easier to use as a filter. Using your flair text aut…