Skip to content

Commit

Permalink
raffles: don't spawn so many daily watch ad quests
Browse files Browse the repository at this point in the history
  • Loading branch information
GGonryun committed Jul 26, 2024
1 parent 9e01522 commit 99d6b9f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions apps/charity/pages/api/cron/spawn-raffle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default createCronJob(async (_, res) => {
});
const tweet = notifications.getTweetNotification(sent);

if (tweet?.data.id && raffle.itemId === '4') {
if (tweet?.data.id && raffle.itemId === '4' && isLucky(0.5)) {
await connectTweet(tweet, data, raffle);
}

Expand Down Expand Up @@ -170,11 +170,19 @@ const selectActions = (
reward: 5,
taskId: 'CAPTCHA_ONCE',
});
actions.push({
order: 0,
reward: randomArrayElement([1, 2, 3, 4, 5]),
taskId: 'WATCH_AD_DAILY',
});
actions.push(
isLucky(0.5)
? {
order: 0,
reward: randomArrayElement([1, 2, 3, 4, 5]),
taskId: 'WATCH_AD_DAILY',
}
: {
order: 0,
reward: randomArrayElement([5, 10]),
taskId: 'WATCH_AD_ONCE',
}
);
} else {
actions.push({
order: 0,
Expand Down

0 comments on commit 99d6b9f

Please sign in to comment.