# Pre Emptive Striker plugin development log

**URL:** <https://meta.discourse.org/t/pre-emptive-striker-plugin-development-log/70845>\
**Category:** Development\
**Created:** [27 سبتمبر 2017، 2:21ص UTC](https://meta.discourse.org/t/pre-emptive-striker-plugin-development-log/70845 "2017-09-27T02:21:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![deevolution](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deevolution/32/70206_2.png) [@deevolution](https://meta.discourse.org/u/deevolution)\
**Post date:** [27 سبتمبر 2017، 2:21ص UTC](https://meta.discourse.org/t/pre-emptive-striker-plugin-development-log/70845/1 "2017-09-27T02:21:17Z")

</div>

Hey, all

As suggested by @erlend_sh, I have created a development log for a plugin I’ve begun developing for Discourse.

I have started work on building what I call the pre-emptive striker plugin (if anyone has a better suggestion for the name, throw it at me!). It was proposed at the beginning of the summer and I’m now officially developing the plugin. Link to original proposal is [here](https://meta.discourse.org/t/pre-emptively-warning-a-contributor-about-the-toxicity-of-their-post/60357).  
Basically, the plugin checks on the user as they are writing for toxicity using [Google’s perspective API.](https://www.perspectiveapi.com/#/) and send JIT notifications if it detects particularly toxic language.

> **[Listen to Yourself](https://xkcd.com/481/)**

I would like some help, however, in understanding how this plugin will interact with the rest of Discourse. I created a quick [Draw.io](http://Draw.io) to illustrate the architecture of the plugin as I understand it in the context of Discourse. Discourse is pretty big to dive into as my first ruby app. I’ve gone through all of the Discourse beginner guides to familiarize my self a bit… [Link to the file](https://github.com/deevolutionism/discourse-preemptive-striker/blob/master/Discourse-Pre-Emptive-Striker) Please download and make edits or point out anything that looks wrong! This is a fairly high-level diagram.

 ![Discourse-Pre-Emptive-Striker](https://global.discourse-cdn.com/meta/original/3X/e/b/eb97d57ce064554bcfb960d5c56cb85d28c6273c.png)

basic user flow goes like this:

1. user begins composing.
2. They type “You’re a dumb person for making that comment, why do you even exist?”
3. As they type, Perspective API is sent requests to analyze the comments. It will return a high toxicity score.
4. The high toxicity score is over a threshold (probably a threshold set in the plugin setting admin panel?) and thus triggers a JIT notification.
5. The user sees the warning, but ignores it and posts anyways! (or they reflect on what they just wrote and proceed to cry because they’ve realized what a terrible person they are..)
6. If they post it, they will be automatically flagged for moderation follow-up.
7. A moderator will review the post and do whatever moderators do best.

**Is there documentation on the API’s for JIT notifications and moderation flagging?**  
Any pointers/guidance there would be greatly appreciated and would speed development up.

I wrote a quick node app that interfaces with PAPI. Next steps are to begin writing it in ruby.

The plugin repo is [here](https://github.com/deevolutionism/discourse-preemptive-striker) for anyone who wants to have a look. It’s pretty bare bones at the moment.

Thanks!

---

_[View the full topic](https://meta.discourse.org/t/pre-emptive-striker-plugin-development-log/70845)._
