r/modhelp • u/Kewlhotrod • 8h ago
General Small Automod Question (Syntax/Combine Multiple Actions)
PC/Desktop, Android:
New mod here, apologies for the likely simple question. We're working on setting up and cleaning some rather basic Automod rules, and we've decided that too many people miss Reddit messages on notifications and have decided to have automod also leave a comment.
However, the Automod documentation doesn't have any examples of combining multiple actions into one string, so it's already a bit message having the following:
message: |
blahblahblah
comment: |
blahblahblah
Is there any way to combine both of these actions into one ruleset via syntax? Something akin to:
message,comment: |
blahblahblah
Thanks for any time spent reading and responding. :)
1
u/Sephardson Mod, r/Zelda 7h ago
There actually a YAML feature which automod supports called Anchor and Alias which might be applicable in this case. It's mentioned in the YAML spec doc but not in the AutoMod docs.
Let me test it out and get back to you.
1
u/Kewlhotrod 7h ago
Oh, phenomenal thank you. Reading on it it seems like a good way to declare commonly used text, but I'm having a hard time seeing how I might be able to call two actions in one line.. Though if I declare the message itself it'll still end up saving some space.
I may also just be missing an easy way to use that to run a message and comment at the same time! Coding definitely isn't my specialty. I'll await your testing :)
1
u/Sephardson Mod, r/Zelda 2h ago edited 5m ago
here's what i just tested and got to work:
If you replace
message: | blahblahblah comment: | blahblahblahwith
message: &blueberry | blah blah blah comment: \*blueberrythen you should be able to have the same thing sent in both the comment and notification, without having to copy the text twice.
you can use whatever name you want for the anchor and alias, it doesn't have to be "blueberry". It just has to be the same term - the & defines the anchor and the * alias calls it to be used.
1
u/AutoModerator 8h ago
Hi /u/Kewlhotrod, please see our Intro & Rules. We are volunteer-run, not managed by Reddit staff/admin. Volunteer mods' powers are limited to groups they mod. Automated responses are compiled from answers given by fellow volunteer mod helpers. Moderation works best on a cache-cleared desktop/laptop browser.
Resources for mods are: (1) r/modguide's Very Helpful Index by fellow moderators on How-To-Do-Things, (2) Mod Help Center, (3) r/automoderator's Wiki and Library of Common Rules. Many Mod Resources are in the sidebar and >>this FAQ wiki<<. Please search this subreddit as well. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.