FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link

Possible logic issue #134

Open computerologist opened 1 year ago

computerologist commented 1 year ago

Copied from Discord: This is probably user error, but I am not seeing the logic I would expect from this:

polling:
  - newSub

runs:
  - name: MyRegularRun
    itemIs:
      - source:
          - 'poll:newSub'
          - 'poll:newComm'
          - 'user'
    checks:           
      - name: nsfw_check
        kind: submission
        itemIs:            
          - over_18: true        

        actions:
          - kind: comment
            name: nsfw_comment
            content: >-
              commentary
            sticky: true
            distinguish: true
            lock: true

      - name: spoilertag_check
        kind: submission
        itemIs:            
          - spoiler: true        

        actions:
          - kind: comment
            name: spoilertag_remove
            content: >-
                commentary
            sticky: true
            distinguish: true
            lock: true  

          - kind: remove
            enable: true

If nsfw_check passes and is actioned, spoliertag_check does not happen.

I can achieve the results I want here by reversing the order, I know, but I don't understand why nsfw_check passing would prevent spoilertag_check from being executed. This will be important for other things I am trying to do. Seems like a bug, or not expected behaviour.