Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help with config #150

Closed
thracyturnix opened this issue Jul 11, 2023 · 7 comments
Closed

Please help with config #150

thracyturnix opened this issue Jul 11, 2023 · 7 comments

Comments

@thracyturnix
Copy link

thracyturnix commented Jul 11, 2023

Thanks for creating and supporting this project.

I am having a bit of trouble with initial config.

Goal:

Bot checks any activity in subreddit against activity in blacklist of subreddits.

If submission or post originates from account with activity in blacklist, remove.

I took the FreeKarma recipe, and modified it, but I suck at any kind of code and have messed it up somewhere.

It loads as a valid config, but it is not removing comments

Testing method:

Use alt account to post in blacklist subreddit, then comment in sub where contextbot is a mod running this script

Expected outcome: comments removed

Actual outcome: no action taken

{
  "runs": [
    {
      "checks": [
        {
          "name": "Fetish-sub activity alert",
          "description": "Check if author has posted in fetish subreddits",
          // check will run on a new submission in your subreddit and look at the Author of that submission
          "kind": "submission",
          "rules": [
            {
              "name": "BBW",
              "kind": "recentActivity",
              "useSubmissionAsReference": false,
              // when `lookAt` is not present this rule will look for submissions and comments.
              // lookAt: "submissions"
              // lookAt: "comments"
              "thresholds": [
                {
                  // for all subreddits, if the number of activities (sub/comment) is equal to or greater than 1 then the rule is triggered
                  "threshold": ">= 1",
                  "subreddits": [
                    "BBW",
                    "BBWhardcore",
                    "BBWpussys",
                    "bbwmilf",
                    "ssbbw",
                    "ebonyBBW",
                    "SBBW_FANS",
                    "ssbbwbutt",
                    "BBWanal",
                    "BBWaddict",
                    "OnlyFansChubbyBBW",
                    "BBWorship",
                    "maturebbw",
                    "BBWass",
                    "Fat_Fetish",
                    "bfatIRL",
                    "stuffersNSFW"
                  ]
                }
              ],
              // will look at all of the Author's activities in the last 7 days
              "window": "7 days"
            }
          ],
          "actions": [
            {
              "kind": "remove",
              "content": "{{rules.BBW.totalCount}} activities in karma {{rules.BBW.subCount}} subs over {{rules.BBW.window}}: {{rules.BBW.subSummary}}"
            }
          ]
        }
      ]
    }
  ]
}

Any chance someone could tell me what I need to change to make this work?

@thracyturnix
Copy link
Author

Hello?

@FoxxMD
Copy link
Owner

FoxxMD commented Jul 18, 2023

Your configuration was close! The major change needed was that check.kind was submission but needed to be comment. kind determines what type of event (new submission or new comment) the bot runs on. Here is an updated config with a few other minor changes:

{
  "runs": [
    {
      "checks": [
        {
          "name": "Fetish-sub activity alert",
          "description": "Check if author has posted in fetish subreddits",
          // check will run on a new submission in your subreddit and look at the Author of that submission
          "kind": "comment",
          "rules": [
            {
              "name": "BBW",
              "kind": "recentActivity",
              "useSubmissionAsReference": false,
              // when `lookAt` is not present this rule will look for submissions and comments.
              // lookAt: "submissions"
              // lookAt: "comments"
              "thresholds": [
                {
                  // for all subreddits, if the number of activities (sub/comment) is equal to or greater than 1 then the rule is triggered
                  "threshold": ">= 1",
                  "subreddits": [
                    "BBW",
                    "BBWhardcore",
                    "BBWpussys",
                    "bbwmilf",
                    "ssbbw",
                    "ebonyBBW",
                    "SBBW_FANS",
                    "ssbbwbutt",
                    "BBWanal",
                    "BBWaddict",
                    "OnlyFansChubbyBBW",
                    "BBWorship",
                    "maturebbw",
                    "BBWass",
                    "Fat_Fetish",
                    "bfatIRL",
                    "stuffersNSFW"
                  ]
                }
              ],
              // will look at all of the Author's activities in the last 7 days
              "window": {
                  "count": 100,
                  "duration": {
                      "days": 7
                  }
              }
            }
          ],
          "actions": [
            {
              "kind": "remove",
              "content": "{{rules.bbw.totalCount}} activities in fetish {{rules.bbw.subCount}} subs over {{rules.bbw.window}}: {{rules.bbw.subSummary}}"
            }
          ]
        }
      ]
    }
  ]
}

@thracyturnix
Copy link
Author

thracyturnix commented Jul 26, 2023

I copy pasted the rule to a test sub. Thanks very much for your reply and for the revised code.

I then used an account to post a comment on one of the blacklisted subs, and came back to test sub and posted a comment with that account.

Expected result is that context mod would remove the comments.

Actual outcome is that the comments remain.

I checked the back end and the bot is running.

I tried restarting the docker and repeating the test but same result.

@thracyturnix
Copy link
Author

Sorry to bump again but we would really like to get this up and running in the Sub. Is there anyone who could help us figure out why its not working?

@thracyturnix
Copy link
Author

Hello?

@FoxxMD
Copy link
Owner

FoxxMD commented Aug 10, 2023

You are likely missing a polling option to tell the bot to look at new comments. You need this to the top of the config:

  "polling": [
    "newComm",
    "newSub"
  ]

Like this

{
  "polling": [
    "newComm",
    "newSub"
  ],
  "runs": [
    {
      "checks": [
        {
          "name": "Fetish-sub activity alert",
          "description": "Check if author has posted in fetish subreddits",
          // check will run on a new submission in your subreddit and look at the Author of that submission
          "kind": "comment",
          "rules": [
            {
              "name": "BBW",
              "kind": "recentActivity",
              "useSubmissionAsReference": false,
              // when `lookAt` is not present this rule will look for submissions and comments.
              // lookAt: "submissions"
              // lookAt: "comments"
              "thresholds": [
                {
                  // for all subreddits, if the number of activities (sub/comment) is equal to or greater than 1 then the rule is triggered
                  "threshold": ">= 1",
                  "subreddits": [
                    "BBW",
                    "BBWhardcore",
                    "BBWpussys",
                    "bbwmilf",
                    "ssbbw",
                    "ebonyBBW",
                    "SBBW_FANS",
                    "ssbbwbutt",
                    "BBWanal",
                    "BBWaddict",
                    "OnlyFansChubbyBBW",
                    "BBWorship",
                    "maturebbw",
                    "BBWass",
                    "Fat_Fetish",
                    "bfatIRL",
                    "stuffersNSFW"
                  ]
                }
              ],
              // will look at all of the Author's activities in the last 7 days
              "window": {
                "count": 100,
                "duration": {
                  "days": 7
                }
              }
            }
          ],
          "actions": [
            {
              "kind": "remove",
              "content": "{{rules.bbw.totalCount}} activities in fetish {{rules.bbw.subCount}} subs over {{rules.bbw.window}}: {{rules.bbw.subSummary}}"
            }
          ]
        }
      ]
    }
  ]
}

@thracyturnix
Copy link
Author

Worked! Thankyou!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants