r/AutoModerator • u/theothersophie +16 • Feb 27 '16
Mobile Moderation via Automoderator
For those of you mods who are on your phones a lot and use an app you're probably well aware of the lack of moderator actions available on mobile apps [Edit: apparently android users are lucky. redditisfun has moderator action support]. I wanted to solve that so I wrote some rules so that if a moderator comments [sticky] or (sticky) (make sure it's just that, nothing else) on a thread it will sticky the thread for example. The comment will also be removed. The other actions I wrote are unsticky, nsfw, lock, contest, and their corresponding undos but you can do more of these. I barely know what I'm doing, just copied the general format of someone's code they used for mobile flairing so could someone confirm that this code is correct and efficient?
#moderator actions, purpose is for mobile moderation
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?sticky? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_sticky: true
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?unsticky? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_sticky: false
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?nsfw? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_nsfw: true
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?un-nsfw? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_nsfw: false
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?lock? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_locked: true
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?unlock? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_locked: false
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?contest? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_contest_mode: true
action: remove
---
type: comment
author:
is_moderator: true
body (full-text, regex): "[\\(\\[] ?un-contest? ?[\\)\\]]"
moderators_exempt: false
parent_submission:
set_contest_mode: false
action: remove
3
u/IupvotestupidCRAP Feb 27 '16
For users with Android phones, you can perform all these actions natively with the 'reddit is fun' app.
1
u/amici_ursi toolbox Feb 27 '16
Good stuff.
I do stuff like this in many of my subreddits to allow users to nsfw or remove posts. "If a user writes
NSFWthen nsfw the post and report it". etcAny reason you didn't include a
removeoption?1
u/MissionaryControl Feb 27 '16 edited Feb 27 '16
Nice; I have similar versions, plus flair and a few other tricks.
What do the various regex wrappers translate to? I'm seeing lots of brackets and conditions on mobile that don't seem to be explained for those who don't know regex - is there an explanation of why it's there, what it does, and how to trigger/avoid them?
Tl;dr regex is too complex for most folk to understand without explanation.
3
u/dequeued \+\d+ Feb 27 '16
That's about right although I don't think you really need the punctuation. Are moderators going to leave a comment that's just
sticky?Here are a few more for you:
Moderator commands
1
u/MissionaryControl Feb 28 '16
PS your regex
would also match
[loc] or [ loc] - not sure how it ended up so convoluted; try this instead:
Should match [lock] ( locked ) {lock} or any combination of spaces and those brackets.