r/AutoModerator • AutoMod Extraordinaire • Apr 26 '19

Avenger's End Game Spoiler Prevention Code

Here's some code I put together to attempt to prevent Marvel / End Game spoilers. Obviously this won't catch everything and people can still get around it, but at a minimum, it should prevent any spoiler copy pasta from being posted. If you feel any modifications should be made to this, please let me know. For those new to AutoMod, you should be able to copy the code below into your AutoMod config without needing to make any changes.

Note: There should be no spoilers within the code below. It is essentially a massive list of Marvel characters/items/actors.

---

    # Avengers End Game Spoiler Prevention
    type: any
    title+body (regex): ['((doctor|dr\.?|incredible|proff?.?|proff?ess?or|she|the).?)?hulk', '(?-i:The (Collector|Hand))', '(?<!.{80})(?<!\bmy )(?<!\byour )end\W?game', '(?<!\ban )abomination', '(car|mar).vell?', '(defenders|avengers).?assembled?', '(doctor|dr)\.?\W?(doom|octopus)', '(doctor|dr\.?|hank|professor) p(i|y)m', '(happy|harold).?hogan', '(hope|hank|janet).?(v(a|o)n.?dyne|pym)', '(infinity|reality|soul|mind|space|time|power|stark).?(stones?|gems?|jewels?|gloves?|gauntlets?)', '(natash|natali)a?.?romano(va?|off)?', '(nick|nicholas).?fury', '(prof?f?.?|doc.?|professor|dr\.?|doctor|master|sorcerer|wizard|ste(ve|phe)n?).?strange', '(rocky|ranger|r(ock|ack|atch)et).?(the.?)?(racc?oo?n|rabb?it)', '(soul|power|reality|time|space|mind)\W?stones?', '(super|the)?s(c|k)rull?s?', '(super|winter).?soldier', '(the.?)?(dead|defeated|great|mad|purple).?titan', '(the.?)?kree', '(the\W?)?avengers?', '[ck]lement[ie]+f+', 'ancient.?one', 'ant.?man', 'ass?gu?ard(ian)?', 'benedict.?cumberbatch', 'big.?green.?guy', 'black.?(panther|widow(?!.?spider))', 'br[ie]{1,2}.?lars[eo]n', 'bradley.?cooper', 'brock.?rumlow', 'bruce.?bann?er', 'bucky(.?barnes?)?', 'cap([^i]\w*)?\W?(america|britain|marvel)', 'carol.?danvers?', 'chadwick.?boseman', 'chris\w*.?(evans|hemsworth)', 'clint(on)?.?barton', 'colossus', 'corvus.?gl[ai]+ve', 'cross.?bones', 'cull.?obsidian', 'daredevil', 'dark.?(patriot|phoenix)', 'deadpool', 'don.?cheadle', 'drax', 'dyne', 'ebony.?maw', 'eitri', 'elektra', 'elizabeth.?olsen', 'enchantress', 'enigma.?force', 'falcon', 'gamorr?a', 'gaunt', 'god.?of.?(mischief|thunder|trick)s?', 'gotg', 'grandmaster', 'green.?goblin', 'green.?rage.?monster', 'groo+t', 'guardians?.?of.?the.?galaxy', 'harley.?keener', 'hawk.?eye', 'heimdall', 'hela', 'heli.?carrier', 'howard.?the.?duck', 'hulk(ling)?', 'infinity.?(stones?|war)', 'iron.?fist', 'iron.?man(?!.{0,60}\b(training|triathlon))', 'iron.?patriot', 'iron\W?lad', 'james.?rhodes', 'jeremy.?renner', 'jigsaw(?!.puzzle)', 'josh.?brolin', 'kamar.?taj', 'karen.?gillan', 'kingpin', 'klaw', 'korg', 'lady.?sif', 'life.?model.?decoy', 'loki', 'luke.?cage', 'm.?baku', 'mantis', 'maria.?hill', 'mark.?ruffalo', 'marvel.?trinity', 'marvel\W?girl', 'meik', 'miss.?america', 'mjolnir', 'mr?s\W+marvel', 'mystic\W?arts', 'natasha', 'nebula(?!.award)', 'nick.?fury', 'nightcrawler', 'odin', 'odin\W?son', 'okoye', 'p(i|y)m\W?particle?', 'paul.?bettany', 'pepp?er.?pott?s?', 'peter.?(parker|quill)', 'professor\W?power', 'professor\W?x', 'proxima.?midnight', 'punisher', 'pym',  'quicksilver', 'red.?skull', 'rhodey', 'ring\W?portal', 'rob\w*.?downey', 'rocket.?raccoon', 'romanoff', 'ronin', 'sam(uel)?.?wilson', 'sanctuary.?(space|star)?ship', 'scarlett.?(johansson|witch)', 'scott?y?.?lang', 'sean.?gunn', 'shuri', 'silver.?surfer', 'sling.?(ring|portal)', 'sorcerer.?supreme', 'spider.?(wo)?man', 'stan\W?lee', 'star.?lord', 'ste(ve|phe)n?.*rogers?', 'storm.?breaker', 't(homas|om).?(hiddleston|holland)', 't.?chall?a?', 'thaddeus.?ross', 'thanos', 'the\W?(mandarin|snap|wasp|watcher)', 'thor', 'thor\W?girl', 'thor\Ws?.?hammer', 'thunder.?god', 'tilda.?swinton', 'tinkerer', 'tony.?stark', 'ultron', 'valk\w*r\w*[eiy]s?', 'van.?dyne?', 'venom', 'vibranium', 'victor.?shade', 'wakandan?s?', 'wanda.?maximo(ff?|v)', 'war.?machine', 'warlock', 'white.?wolf', 'winter.?soldier', 'wolverine', 'x\W?m[ae]n', 'zoe.?saldana']
    action: remove
    action_reason: 'Possible End Game Spoilers'
    modmail_subject: 'Possible End Game Spoilers'
    modmail: 'This [{{kind}}]({{permalink}}) has been removed due to being detected as possible Avengers: End Game spoilers (it contained keyword: >!{{match}}!<). Investigate at your own risk to confirm that this action was not made in error.'

---

Edit 1: Removed the following code in order to prevent trolls from being notified that their posts were removed. However, I've left the modmail notification so that mods can double check that the code is working appropriately (at your own risk).

    message_subject: 'Possible End Game Spoilers'    
    message: 'Your [{{kind}}]({{permalink}}) has been removed due to being detected as possible Avengers: End Game spoilers. If you believe this action was made in error, please [message the mods](https://reddit.com/message/compose?to=/r/{{subreddit}}).'

Edit 2: Thanks to an anonymous contributor, I've updated the regex to a much more thorough and complete list!

Edit 3: Thanks for the gold!

43 Upvotes

18 comments sorted by

9

u/GaZzErZz +1 Apr 26 '19

Just a quick browse. Pym is incorrectly spelt. Maybe add that as well as pim

2

u/coloneljdog AutoMod Extraordinaire Apr 26 '19

Thanks! Fixed.

7

u/strawberrytainted Apr 26 '19

This automod is the real MVP here. Thanks for setting this up :)

2

u/coloneljdog AutoMod Extraordinaire Apr 26 '19

Hey I just updated the code to a much more thorough and complete list. You should update your code too to the latest version I have in my post.

4

u/strawberrytainted Apr 26 '19

I don't control an automod, I'm not a mod either. I'm just a human user that's going around and helping report End Game spoilers that aren't appropriate in those subs. Throughout doing this, I've noticed how effective your automod code is at helping lessen these offenses and wanted to say thank you for doing your part! (For real though, a lot of comment sections have been saved because of this)

1

u/FreydNot Apr 26 '19

Spoiler alert!

5

u/coloneljdog AutoMod Extraordinaire Apr 26 '19

The code essentially only contains a list of Marvel characters/items. There should be no spoilers within the code itself.

1

u/FreydNot Apr 26 '19

Fair point, but some people are very sensitive about potential spoilers (beyond logic).

2

u/coloneljdog AutoMod Extraordinaire Apr 26 '19

I understand. I added a note at the top of my post before the code begins that there are no spoilers within the code itself.

2

u/FreydNot Apr 26 '19

Much appreciated

1

u/seth1299 Scratch > Automod Apr 28 '19

Just wanted to drop by after my comment yesterday and say thanks.

https://imgur.com/a/hLV66ds

2

u/coloneljdog AutoMod Extraordinaire Apr 28 '19

Wow, glad I could help!

3

u/seth1299 Scratch > Automod Apr 28 '19

People are making alt accounts just to troll and post spoilers, it’s quite pathetic.

I made a separate trigger for new accounts now that has the “I’m sorry, little one” for the action_reason lol

2

u/NoahBM regex Apr 26 '19

If you put in \\s* in between every letter, it should ignore spaces (e.g. ma rvel would still be removed). It might be a bit of work, but it also might be worth it.

2

u/seth1299 Scratch > Automod Apr 27 '19

Man I just spent like 30 minutes typing up code for this that isn't even regex.

Thanks anyway, the regex will be much better!

2

u/GeekToTechModbot Apr 27 '19

Awesome Work!!

1

u/ElCamo267 Oct 06 '19

You used the spoilers to destroy the spoilers. Impressive.

0

u/[deleted] Apr 26 '19

[deleted]

1

u/coloneljdog AutoMod Extraordinaire Apr 26 '19

That's a valid point. I think in that case, I'll remove the message function, but leave the modmail function. I'd like to be notified when this code removes something so I can verify it was correct (I've already seen End Game so I'm good as far as spoilers go). I didn't want to simply filter these items in order to not spoil other moderators. So having them removed + modmail seems like the best option.