Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ~~~ Option 1 ~~~
- ---
- # Adding a character to the user's flair when they post
- type: submission
- is_edited: false
- author:
- set_flair:
- text: "{{author_flair_text}}I"
- template_id: "{{author_flair_template_id}}"
- overwrite_flair: true
- ---
- You can also do it with levels:
- ---
- # Adding a character to the user's flair when they post
- type: submission
- is_edited: false
- author:
- ~flair_text (includes-word): ["Beginner IIIII", "Intermediate IIIII", "Advanced IIIII"]
- set_flair:
- text: "{{author_flair_text}}I"
- template_id: "{{author_flair_template_id}}"
- overwrite_flair: true
- ---
- # Changing "Beginner IIIII" to "Intermediate I"
- type: submission
- is_edited: false
- author:
- flair_text (includes-word): ["Beginner IIIII"]
- set_flair:
- text: "Intermediate I"
- template_id: "{{author_flair_template_id}}"
- overwrite_flair: true
- ---
- # Changing "Intermediate IIIII" to "Advanced I"
- type: submission
- is_edited: false
- author:
- flair_text (includes-word): ["Intermediate IIIII"]
- set_flair:
- text: "Advanced I"
- template_id: "{{author_flair_template_id}}"
- overwrite_flair: true
- ---
- ~~~ Option 2 ~~~
- With each additional rule you need to increase the numbers in the priority/flair_text/text lines
- ---
- # Detect 1st new post by a user
- priority: 0 # run this rule after the other rules because otherwise when this rule finishes then the next rule will detect the changed flair and act on it even though it's the same post
- type: submission
- is_edited: false
- author:
- ~flair_text (full-text, regex): '\d+'
- set_flair:
- template_id: "the id of the flair you want to give"
- text: "1"
- overwrite_flair: true
- ---
- # Detect 2nd post by a user
- priority: 1 # run this before the previous rule
- type: submission
- is_edited: false
- author:
- flair_text (full-text): "1"
- set_flair:
- template_id: "the id of the flair you want to give" # can also use {{author_flair_template_id}} to refer to the existing one
- text: "2"
- overwrite_flair: true
- ---
- # Detect 3rd post by a user
- priority: 2 # run this before the previous rule
- type: submission
- is_edited: false
- author:
- flair_text (full-text): "2"
- set_flair:
- template_id: "the id of the flair you want to give"
- text: "3"
- overwrite_flair: true
- ---
- ~~~ Option 3 ~~~
- With each additional rule you need to increase the numbers in the priority/flair_text/text lines
- ---
- # Detect 1st new post by a user
- priority: 0 # run this rule after the other rules because otherwise when this rule finishes then the next rule will detect the changed flair and act on it even though it's the same post
- type: submission
- is_edited: false
- author:
- ~flair_text (ends-with, regex): '\(\d+\)'
- set_flair:
- template_id: "the id of the flair you want to give"
- text: "Beginner (1)"
- overwrite_flair: true
- ---
- # Detect 2nd post by a user
- priority: 1 # run this before the previous rule
- type: submission
- is_edited: false
- author:
- flair_text (ends-with): "(1)"
- set_flair:
- template_id: "the id of the flair you want to give" # you can also use {{author_flair_template_id}} to refer to the existing one
- text: "Beginner (2)"
- overwrite_flair: true
- ---
- # Detect 3rd post by a user
- priority: 2 # run this before the previous rule
- type: submission
- is_edited: false
- author:
- flair_text (ends-with): "(2)"
- set_flair:
- template_id: "the id of the flair you want to give"
- text: "Beginner (3)"
- overwrite_flair: true
- ---
- ~~~ Option 4 ~~~
- Note that the flair will not have a design because it's not possible to specify template_id because it overrides the specified css_class)
- With each additional rule you need to increase the numbers in the priority/flair_text/text lines
- ---
- # Detect 1st new post by a user
- priority: 0 # run this rule after the other rules because otherwise when this rule finishes then the next rule will detect the changed flair and act on it even though it's the same post
- type: submission
- is_edited: false
- author:
- ~flair_css_class (full-text, regex): '\d+'
- set_flair: ["Beginner", "1"]
- overwrite_flair: true
- ---
- # Detect 2nd post by a user
- priority: 1 # run this before the previous rule
- type: submission
- is_edited: false
- author:
- flair_css_class (full-text): "1"
- set_flair: ["Beginner", "2"]
- overwrite_flair: true
- ---
- # Detect 3rd post by a user
- priority: 2 # run this before the previous rule
- type: submission
- is_edited: false
- author:
- flair_css_class (full-text): "2"
- set_flair: ["Beginner", "3"]
- overwrite_flair: true
- ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement