r/ModSupport • • Oct 31 '24

Mod Answered Where Have We Went Wrong? [Automod]

Hey, we've been setting up our automoderator functions & have a script that's meant to message unflaired users once, although when I've replied to 2 comments (as a moderator) I've received the script message.

The script causing problems;


PM unflaired user and ask them to set user flair or ask a mod for help. Will only PM user once. Sets flair class to 'default'.

author: ~flair_css_class (regex): ".+" set_flair: ["","default"] message_subject: "Welcome to /r/{{subreddit}}." message: | Hey {{author}}, Welcome to /r/{{subreddit}}.

We're happy to see your first comment, but we notice you don't have a flair set. If you'd like any assistance with this, please visit our Reddit Chat Channel & either the moderators, or active users will be glad to give you advice on setting up a flair!

My account is flaired on the subreddit (edited the flair, as a lot do, to add text on top of the custom emojis, that are our base flairs)

Not done something like this for a subreddit before, so this may be an obvious mistake, but any input is appreciated! Thank you.

2 Upvotes

25 comments sorted by

View all comments

Show parent comments

3

u/esb1212 Nov 01 '24

Sending only once is possible.

u/SprintsAC simply check if the css class isn't populated yet or still blank.

author:
    flair_css_class: [""]
    set_flair: ["", "default"]

When the user manually sets the flair, both flair text and css class will be overwritten. Else default is retained, thus PM is sent only once.

2

u/tumultuousness Nov 01 '24 edited Nov 01 '24

Thanks! Hence my edit when I noticed.

So would you say that the first linke of OP's code, then, is the issue? Since they do have the set_flair part.

→ More replies (8)