Advertisement
Guest User

Untitled

a guest
Aug 12th, 2022
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. ~~~ Option 1 ~~~
  2.  
  3. ---
  4. # Adding a character to the user's flair when they post
  5. type: submission
  6. is_edited: false
  7. author:
  8. set_flair:
  9. text: "{{author_flair_text}}I"
  10. template_id: "{{author_flair_template_id}}"
  11. overwrite_flair: true
  12. ---
  13.  
  14. You can also do it with levels:
  15.  
  16. ---
  17. # Adding a character to the user's flair when they post
  18. type: submission
  19. is_edited: false
  20. author:
  21. ~flair_text (includes-word): ["Beginner IIIII", "Intermediate IIIII", "Advanced IIIII"]
  22. set_flair:
  23. text: "{{author_flair_text}}I"
  24. template_id: "{{author_flair_template_id}}"
  25. overwrite_flair: true
  26. ---
  27. # Changing "Beginner IIIII" to "Intermediate I"
  28. type: submission
  29. is_edited: false
  30. author:
  31. flair_text (includes-word): ["Beginner IIIII"]
  32. set_flair:
  33. text: "Intermediate I"
  34. template_id: "{{author_flair_template_id}}"
  35. overwrite_flair: true
  36. ---
  37. # Changing "Intermediate IIIII" to "Advanced I"
  38. type: submission
  39. is_edited: false
  40. author:
  41. flair_text (includes-word): ["Intermediate IIIII"]
  42. set_flair:
  43. text: "Advanced I"
  44. template_id: "{{author_flair_template_id}}"
  45. overwrite_flair: true
  46. ---
  47.  
  48.  
  49.  
  50. ~~~ Option 2 ~~~
  51.  
  52. With each additional rule you need to increase the numbers in the priority/flair_text/text lines
  53.  
  54. ---
  55. # Detect 1st new post by a user
  56. 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
  57. type: submission
  58. is_edited: false
  59. author:
  60. ~flair_text (full-text, regex): '\d+'
  61. set_flair:
  62. template_id: "the id of the flair you want to give"
  63. text: "1"
  64. overwrite_flair: true
  65. ---
  66. # Detect 2nd post by a user
  67. priority: 1 # run this before the previous rule
  68. type: submission
  69. is_edited: false
  70. author:
  71. flair_text (full-text): "1"
  72. set_flair:
  73. template_id: "the id of the flair you want to give" # can also use {{author_flair_template_id}} to refer to the existing one
  74. text: "2"
  75. overwrite_flair: true
  76. ---
  77. # Detect 3rd post by a user
  78. priority: 2 # run this before the previous rule
  79. type: submission
  80. is_edited: false
  81. author:
  82. flair_text (full-text): "2"
  83. set_flair:
  84. template_id: "the id of the flair you want to give"
  85. text: "3"
  86. overwrite_flair: true
  87. ---
  88.  
  89.  
  90.  
  91. ~~~ Option 3 ~~~
  92.  
  93. With each additional rule you need to increase the numbers in the priority/flair_text/text lines
  94.  
  95. ---
  96. # Detect 1st new post by a user
  97. 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
  98. type: submission
  99. is_edited: false
  100. author:
  101. ~flair_text (ends-with, regex): '\(\d+\)'
  102. set_flair:
  103. template_id: "the id of the flair you want to give"
  104. text: "Beginner (1)"
  105. overwrite_flair: true
  106. ---
  107. # Detect 2nd post by a user
  108. priority: 1 # run this before the previous rule
  109. type: submission
  110. is_edited: false
  111. author:
  112. flair_text (ends-with): "(1)"
  113. set_flair:
  114. 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
  115. text: "Beginner (2)"
  116. overwrite_flair: true
  117. ---
  118. # Detect 3rd post by a user
  119. priority: 2 # run this before the previous rule
  120. type: submission
  121. is_edited: false
  122. author:
  123. flair_text (ends-with): "(2)"
  124. set_flair:
  125. template_id: "the id of the flair you want to give"
  126. text: "Beginner (3)"
  127. overwrite_flair: true
  128. ---
  129.  
  130.  
  131.  
  132. ~~~ Option 4 ~~~
  133.  
  134. 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)
  135.  
  136. With each additional rule you need to increase the numbers in the priority/flair_text/text lines
  137.  
  138. ---
  139. # Detect 1st new post by a user
  140. 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
  141. type: submission
  142. is_edited: false
  143. author:
  144. ~flair_css_class (full-text, regex): '\d+'
  145. set_flair: ["Beginner", "1"]
  146. overwrite_flair: true
  147. ---
  148. # Detect 2nd post by a user
  149. priority: 1 # run this before the previous rule
  150. type: submission
  151. is_edited: false
  152. author:
  153. flair_css_class (full-text): "1"
  154. set_flair: ["Beginner", "2"]
  155. overwrite_flair: true
  156. ---
  157. # Detect 3rd post by a user
  158. priority: 2 # run this before the previous rule
  159. type: submission
  160. is_edited: false
  161. author:
  162. flair_css_class (full-text): "2"
  163. set_flair: ["Beginner", "3"]
  164. overwrite_flair: true
  165. ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement