New AutoMod Feature

AutoMod is alive! Thanks to /u/Lucid_Enemy suggestion, I put in a new feature for AutoMod. In fact, this post should test that feature. Its always been an annoyance that when you try to summon a person in a post/submission, that person is not notified as they would have been if it would have been made in a comment.

AutoMod wants to help you. Now, when there is a user summoned in a post, AutoMod will make a comment with the person you have summoned. So it should be unnecessary now for others to have to add a comment to summon a person mentioned in a post! Thank's Lucid. For making a worthwhile suggestion that helps the community, I'll add some flair if you wish for 30 days.

One "issue" though, if you summon multiple people, only the first one you mention will be in the AutoMod reply.

Request for help: Does anybody out there know how I can include multiple matches for a regex in the comment reply that AutoMod makes? For instance, if a post contains 3 different usernames, I want AutoMod's reply to have all 3, not just the first one as it does now. If anybody can solve this, I will grant 30 day flair as well :) Your sub is asking for your patriotism and duty to the DNMs. I'm not an AutoMod expert so hopefully this is something fairly easy.

Hope this helps a little bit.


Comments


[6 Points] AutoModerator:

/u/Lucid_Enemy - You have been summoned in the thread /r/DarkNetMarkets/comments/5171pk/new_automod_feature/ by /u/Theeconomist1.

This convenience is brought to you by AutoMod. Submissions do not automatically summon users like comments do. AutoMod is trying to be helpful.

For others, it should no longer be necessary to summon the referenced user in a comment any more. AutoMod has done the heavy lifting for you. You're welcome. Bow before me.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.


[3 Points] Lucid_Enemy:

I would love a flair :)


[1 Points] RaveTurkey01:

What language does automod use


[1 Points] None:

[deleted]


[1 Points] ForLol_Serious:

Can u make it so every time automod summons someone he also summons /u/daretohope ?


[1 Points] jjcooli0h:

I've never used this Automod thing but are you saying that even when using a capture group like e.g.,

url+body (includes, regex): ['(?:(?<=\/u\/)([\w-]+))']

 


 

and then in the body of AutoMod's comment action, using:

"AutoMod is hereby paging /u/{{match-2}}"

 

→ then that still doesn't work?

Remember, that for indexed matches:

{{match-2}} is ≈ /(?P<capture-group-1>…)/


 

Now, if you have tried the indexed match approach above, and it still doesn't work then it must be because the regex isn't internally specified with the global flag.
Basically that's saying that the AutoMod functionality does not iterate over captured matches.

i.e. /<regex>/mig

 

Then in which case you may need to do some fancy alternations; either as individual matches:

 

 body (includes, regex): ['
  (?:(?<=\/u\/)([\w-]+).*?    # match 3x /u/users
    (?<=\/u\/)([\w-]+).*?  
      (?<=\/u\/)([\w-]+))',  

  (?:(?<=\/u\/)(?:[\w-]+).*?  # match 2x /u/users
    (?<=\/u\/)([\w-]+))',  

  (?:(?<=\/u\/)([\w-]+))      # match 1x /u/user
 ']

 

or as ...|... regex alternationssee below, etc

 

body (includes, regex): ['  
(?:(?:(?<=\/u\/)([\w-]+).*?
    (?<=\/u\/)([\w-]+).*?  
      (?<=\/u\/)([\w-]+))|  
  (?:(?<=\/u\/)(?:[\w-]+).*?  
    (?<=\/u\/)([\w-]+))|  
  (?:(?<=\/u\/)([\w-]+)))  
 ']

 

NOTE The new lines and the # comments in the regex are just for display - naturally, these need to be removed for the actual regular expression.