Exclude contracts with trump and president in the name

This commit is contained in:
Ian Philips 2022-08-18 17:10:15 -06:00
parent 5efe5e56f5
commit 5dcbf6e05d

View File

@ -42,7 +42,13 @@ async function sendTrendingMarketsEmailsToAllUsers() {
const privateUsersToSendEmailsTo = privateUsers.filter((user) => {
return !user.unsubscribedFromWeeklyTrendingEmails
})
const trendingContracts = await getTrendingContracts()
const trendingContracts = (await getTrendingContracts()).filter(
(contract) =>
!(
contract.question.toLowerCase().includes('trump') &&
contract.question.toLowerCase().includes('president')
)
)
for (const privateUser of privateUsersToSendEmailsTo) {
if (!privateUser.email) {
log(`No email for ${privateUser.username}`)