Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variations to messages #7

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/scheduled/milestone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ const milestoneScheduled = async (
const content = [
`# ${emojiRegular(env, "hype")} ${money("£", recentMilestone, false)}`,
"",
`${emojiRegular(env, "mascot")} Jingle Jam ${stats.event.year} just hit a new milestone, with ${totalRaised} raised so far through the Yogscast and fundraisers.`,
`:black_small_square: There have already been ${collections} Games Collections claimed, and our ${countFundraisers} fundraisers have raised ${totalFundraisers}!`,
Math.random() < 0.5
? `${emojiRegular(env, "mascot")} Jingle Jam ${stats.event.year} just hit a new milestone, with ${totalRaised} raised so far through the Yogscast and fundraisers.`
: `${emojiRegular(env, "mascot")} A new milestone has been reached! Jingle Jam ${stats.event.year} has raised ${totalRaised} so far through the Yogscast and fundraisers.`,
Math.random() < 0.5
? `:black_small_square: There have already been ${collections} Games Collections claimed, and our ${countFundraisers} fundraisers have raised ${totalFundraisers}!`
: `:black_small_square: ${collections} Games Collections have already been claimed, and our ${countFundraisers} fundraisers have raised ${totalFundraisers}!`,
"",
thanks(new Date(stats.event.end), stats.event.year, env),
].join("\n");
Expand Down
32 changes: 22 additions & 10 deletions src/scheduled/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,28 @@ const summaryScheduled = async (
const content = [
`# ${emojiRegular(env, "mascot")} Jingle Jam ${stats.event.year} Day ${daysSinceLaunch} Summary`,
"",
`${emojiRegular(env, "happy")} ${
ended ? "We" : "We've"
} raised a total of ${totalRaised} for charity over the ${timeElapsed} of Jingle Jam ${
stats.event.year
}${ended ? "!" : " so far!"}`,
`:black_small_square: There ${
ended ? "were" : "have already been"
} ${collections} Games Collections redeemed, and ${fundraisers} fundraisers ${
ended ? "joined" : "have joined"
} to raise money for charity.`,
Math.random() < 0.5
? `${emojiRegular(env, "happy")} ${
ended ? "We" : "We've"
} raised a total of ${totalRaised} for charity over the ${timeElapsed} of Jingle Jam ${
stats.event.year
}${ended ? "!" : " so far!"}`
: `${emojiRegular(env, "happy")} ${
ended ? "We" : "We've"
} raised ${totalRaised} for charity in just ${timeElapsed} of Jingle Jam ${
stats.event.year
}!`,
Math.random() < 0.5
? `:black_small_square: There ${
ended ? "were" : "have already been"
} ${collections} Games Collections redeemed, and ${fundraisers} fundraisers ${
ended ? "joined" : "have joined"
} to raise money for charity.`
: `:black_small_square: ${collections} Games Collections ${
ended ? "were" : "have already been"
} redeemed, and ${fundraisers} fundraisers ${
ended ? "joined" : "have joined"
} the cause.`,
"",
causesBreakdown(stats, env),
"",
Expand Down
12 changes: 8 additions & 4 deletions src/util/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ export const thanks = (end: Date, year: number, env: Env) => {

// Otherwise, show the time remaining
return (
`${emojiRegular(env, "love")} Thank you for supporting some wonderful causes!` +
`\n:mega: There ${
/^(\D*1|less) /.test(timeRemaining) ? "is" : "are"
} still ${timeRemaining} remaining to get involved and grab the collection at <https://jinglejam.co.uk/donate>`
(Math.random() < 0.5
? `${emojiRegular(env, "love")} Thank you for supporting some wonderful causes!`
: `${emojiRegular(env, "love")} Your support means the world to these amazing causes. Thank you!`) +
(Math.random() < 0.5
? `\n:mega: There ${
/^(\D*1|less) /.test(timeRemaining) ? "is" : "are"
} still ${timeRemaining} remaining to get involved and grab the collection at <https://jinglejam.co.uk/donate>`
: `\n:mega: Keep the momentum going! With ${timeRemaining} left, grab your collection at <https://jinglejam.co.uk/donate>`)
);
};

Expand Down
Loading