Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers

fix violations

this wasn't generating properly

+8 -8
+8 -8
src/utils/db/violations.ts
··· 43 43 }; 44 44 45 45 function createObjForValuesChange (violationType: AccountStatus[], value: boolean) { 46 - let valuesUpdate:LooseObj = {}; 47 - if (AccountStatus.InvalidAccount in violationType) 46 + let valuesUpdate: LooseObj = {}; 47 + if (violationType.includes(AccountStatus.InvalidAccount)) 48 48 valuesUpdate.userPassInvalid = value; 49 49 50 - if (AccountStatus.Suspended in violationType) 50 + if (violationType.includes(AccountStatus.Suspended)) 51 51 valuesUpdate.accountSuspended = value; 52 52 53 - if (AccountStatus.MediaTooBig in violationType) 53 + if (violationType.includes(AccountStatus.MediaTooBig)) 54 54 valuesUpdate.mediaTooBig = value; 55 55 56 - if (AccountStatus.TOSViolation in violationType) 56 + if (violationType.includes(AccountStatus.TOSViolation)) 57 57 valuesUpdate.tosViolation = value; 58 58 59 - if (AccountStatus.TakenDown in violationType || AccountStatus.Deactivated in violationType) 59 + if (violationType.includes(AccountStatus.TakenDown) || violationType.includes(AccountStatus.Deactivated)) 60 60 valuesUpdate.accountGone = value; 61 61 62 62 return valuesUpdate; ··· 76 76 console.error("unable to get database to create violations for"); 77 77 return false; 78 78 } 79 + 79 80 let violationsArray = []; 80 81 violationsArray.push(violationType); 81 82 violationsArray = flatten(violationsArray); 82 - 83 83 const valuesUpdate: LooseObj = createObjForValuesChange(violationsArray, true); 84 - console.log(`making violations array ${violationsArray}, had updates of ${valuesUpdate}`); 85 84 86 85 // handle auto-bans 87 86 if (violationType === AccountStatus.TOSViolation) { ··· 95 94 96 95 // if there are no violations, then give none. 97 96 if (isEmpty(valuesUpdate)) { 97 + //console.log("no value change"); 98 98 return false; 99 99 } 100 100