I have inherited a bot on Reddit that sets user flair, its Python based. I have a set of rules that interact with the bot that tells it what is acceptable to add. That snippet is as below
{ "rules": [ { "set": { "text": [ "Dogs Samsung Chinese lol", "Island of Extinction", "Hi Alison!", "My Favorite Was Robbed", "Rupert For Governor", "Sticky Situation", "Mark The Chicken", "COLESLAW!?!?", "Sandra", "Boston Rob", "Lairo", "Vokai", "Island of the Idols" ], "limit": { "available": 0, "expires": 9999999999, "usergroup": "all" }, "class": [ { "content": "X", "limit": { "available": 0, "expires": 9999999999, "usergroup": "all" }, "type": "string" }, { "content": " W", "type": "string" }, { "content": "(?<=W)(.?)(?=W)", "type": "regex" }, { "content": "W ", "type": "string" }, { "content": "W.W(.)", "type": "regex" } ], "setname": "GreyFlairs" } }, { "set": { "text": [ "Andrew (AUS)", "Baden (AUS)", "Benny (AUS)", "Cara (AUS)", "Chelsea (AUS)", "Daini (AUS)", "Dani (AUS)", "Emmett (AUS)", "Flick (AUS)", "Gavin (AUS)", "George (AUS)", "Georgia (AUS)", "Gerald (AUS)", "Hayley (AUS)", "Janelle (AUS)", "Joey (AUS)", "Kez (AUS)", "Laura (AUS)", "Mitch (AUS)", "Phil (AUS)", "Rachel (AUS)", "Shannon (AUS)", "Simon (AUS)", "Wai (AUS)" ], "limit": { "available": 0, "expires": 1634270400, "usergroup": "all" }, "class": [ { "content": "A6Gold", "limit": { "available": 0, "expires": 1627205400, "usergroup": "all" }, "type": "string" }, { "content": "A6Silver", "limit": { "available": 1627205401, "expires": 1634270400, "usergroup": "all" }, "type": "string" }, { "content": " W", "type": "string" }, { "content": "(?<=W)(.?)(?=W)", "type": "regex" }, { "content": "W ", "type": "string" }, { "content": "W.W(.)", "type": "regex" } ], "setname": "AustralianSurvivorAllStars" } }, { "set": { "text": [ "Yam Yam", "Matt", "Brandon", "Kane", "Carson", "Matthew", "Lauren", "Heidi", "Helen", "Frannie", "Danny", "Bruce", "Maddy", "Claire", "Jaime", "Sarah", "Carolyn", "Josh" ], "limit": { "available": 0, "expires": 1678327200, "usergroup": "all" }, "class": [ { "content": "44Gold", "limit": { "available": 0, "expires": 1678327200, "usergroup": "all" }, "type": "string" }, { "content": "44Silver", "limit": { "available": 1678327201, "expires": 1709949600, "usergroup": "all" }, "type": "string" }, { "content": " W", "type": "string" }, { "content": "(?<=W)(.?)(?=W)", "type": "regex" }, { "content": "W ", "type": "string" }, { "content": "W.W(.*)", "type": "regex" } ], "setname": "Season44" } } ] }
It looks like to me that this part
{ "content": " W", "type": "string" }, { "content": "(?<=W)(.?)(?=W)", "type": "regex" }, { "content": "W ", "type": "string" }, { "content": "W.W(.)", "type": "regex" }
is telling it to ignore text between the the letters W (so WtextW). I want to do that in the text portion as well, but I'm unsure how to format that in the code. Can anybody help?
I tried to take the above snippet and put it in the text part but I must have put it in the wrong place because it broke the whole thing.