BeAmazed Moderation App
This is a port of u/BeAmazed-Modbot. This moderation app is intended to be used for r/BeAmazed subreddit only.
Currently there are three functionalities, each having a toggle on/off option.
- Community Feedback Sticky Comment - Leaves a sticky comment on every new post.
- Reported Comments Moderation - Moderates reported comments based on configured conditions.
- Reported Posts Moderation - Moderators reported posts based on configured conditions.
- Periodic Posts Moderation - Periodically goes through specified number of new posts and moderates them based on configured conditions.
- Recent Popular Cross-post Removal - When a cross-post is submitted, it removes it based on configured conditions.
Functionalities
1) Community Feedback Sticky Comment
- Makes a sticky comment on every new post.
- Text for the Sticky Comment can be configured through app settings.
- If text is left empty, then app won't leave any Sticky Comment.
- The sticky comment is always locked by default.
2) Reported Comments Moderation
- This particular code runs every 20 mins and goes through a certain number of reported comments. That number can be configured in app settings.
- If reported comment has less than certain score, then it removes the comment.
- There are 3 conditions available. For each condition we can set a different removal score.
- Comments with 1 report.
- Comments with 2 or more reports.
- Comments with Priority Reports (in app settings we can specify what are priority reports)
- Even if the conditions are met, the app won't remove a comment if it's made by the moderators of the subreddit or if the comment was previously approved.
3) Reported Posts Moderation
- Whenever a post is reported, this code removes the post if it meets the conditions configured in app settings.
- You also get option to configure the removal comment and the post flair that the app leaves on removed posts. If removal comment is left empty, the app won't post any removal comment but if post flair ID is left empty, the app will add a default post flair "[Removed]".
- There is "{username}" placeholder available in removal comment. This means that if anywhere in text "{username}" is written, it will replace it with the name of the post's author. Placeholder is case-insensitive, so "{userNAME}" or any other case combination will work.
- You get option to specify multiple removal conditions in app settings. Here are the available parameters for these conditions and their respective order:
- <= Sticky Comment Score
- <= Upvote Ratio
- >= Total Number of Votes (upvotes + downvotes)
- <= Hours since published
- The conditions need to be written in a very specific format and order, so that they work as intended.
- Each parameter in a condition needs to be separated by comma.
- Each condition statement needs all 4 parameters, otherwise it will fill the empty parameters by value 0.
- In case of multiple condition statements, separate each of them with semicolon.
- Here's an example of a condition statement.
- -5,0.85,100,12
- This conditions statement means that the code will remove reported posts if:
Sticky Comment Score <= -5 && Upvote Ratio <= 0.85 && Total Number of Votes >= 100 && Hours since published <= 12
- Write multiple conditions like this:
-5,0.85,100,12;
1000,0.75,100,12
- In app settings there is also option to whitelist users and whitelist posts against Reported Posts Moderation.
- While whitelisting users, don't add "u/" prefix and separate multiple users with comma.
- While whitelisting posts, write postID, but don't add "t3_" prefix, and separate multiple postID's with comma.
4) Periodic Posts Moderation
- This code periodically checks the certain amount of recent posts and removes them if they meet configured conditions.
- You get option to specify number of posts it checks and also multiple removal conditions in app settings. Here are the available parameters for these conditions and their respective order:
- <= Sticky Comment Score
- <= Post's Score
- >= Hours since published (or Hours since approved in case the post is approved)
- The conditions need to be written in a very specific format and order, so that they work as intended.
- Each parameter in a condition needs to be separated by comma.
- Each condition statement needs all 3 parameters, otherwise it will fill the empty parameters by value 0.
- In case of multiple condition statements, separate each of them with semicolon.
- Here's an example of a condition statement.
- 0,5,4
- This conditions statement means that the code will remove reported posts if:
Sticky Comment Score <= 0 && Post's Score <= 5 && Hours since published >= 4
- Write multiple conditions like this:
0,5,4;
0,10,12
- Both this feature and the "Reported Posts Moderation" feature, shares the same whitelisted users, whitelisted posts, removal comment and flairID fields.
5) Recent Popular Cross-post Removal
- When a post is created, it checks if it's a cross-post or not. If it's a cross-post and it meets the configured removal conditions, then it removes the post.
- You also get option to configure the removal comment and the post flair that the app leaves on removed posts. If removal comment is left empty, the app won't post any removal comment but if post flair ID is left empty, the app will add a default post flair "[Removed] Popular Cross-post".
- There is "{username}" placeholder available in removal comment. This means that if anywhere in text "{username}" is written, it will replace it with the name of the post's author. Placeholder is case-insensitive, so "{userNAME}" or any other case combination will work.
- You get option to specify multiple removal conditions in app settings. Here are the available parameters for these conditions and their respective order:
- >= Original Post Score
- <= Original Post's Days since published
- The conditions need to be written in a very specific format and order, so that they work as intended.
- Each parameter in a condition needs to be separated by comma.
- Each condition statement needs both 2 parameters, otherwise it will fill the empty parameters by value 0.
- In case of multiple condition statements, separate each of them with semicolon.
- Here's an example of a condition statement.
- 50000,30
- This conditions statement means that the code will remove a cross-post if:
Original Post Score >= 50000 && Original Post's Days since published <= 30
- Write multiple conditions like this:
50000,30;
70000,60
- The code will not remove the post if the author of the cross-post is same as the author of the original post.
Change log
Latest Version (v1.0.2)
- Fixed a bug where Sticky Comment was not posting if the post is a cross-post where the crosspostAuthor and originalPostAuthor are same.
- Fixed a bug in Reported Posts Moderation related to how it takes createdAt time.
v1.0.1
- Added "Recent Popular Cross-post Removal" feature.
- Adding "Periodic Posts Moderation" feature.
- Reported Comments Moderation - Fixed a minor bug when a comment receives null report.
v0.0.19
- Reported Posts Moderation - Added a "{username}" placeholder in the removal comment text. Writing "{username}" in the text will replace it with removed post's author name."
- Reported Posts Moderation - Fixed a bug where if a removed post receives another report, the app leaves additional removal comment on it.
- Sticky Comment - The sticky comment left by app is now locked by default.
- Updated few console.log commands.
v0.0.17