Skip to content

Commit 5450a57

Browse files
authored
Add variations to messages (#7)
* Add variations to summary message * Add variations to thanks message * Add variations to milestone message
1 parent 7a414db commit 5450a57

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

src/scheduled/milestone.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ const milestoneScheduled = async (
5454
const content = [
5555
`# ${emojiRegular(env, "hype")} ${money("£", recentMilestone, false)}`,
5656
"",
57-
`${emojiRegular(env, "mascot")} Jingle Jam ${stats.event.year} just hit a new milestone, with ${totalRaised} raised so far through the Yogscast and fundraisers.`,
58-
`:black_small_square: There have already been ${collections} Games Collections claimed, and our ${countFundraisers} fundraisers have raised ${totalFundraisers}!`,
57+
Math.random() < 0.5
58+
? `${emojiRegular(env, "mascot")} Jingle Jam ${stats.event.year} just hit a new milestone, with ${totalRaised} raised so far through the Yogscast and fundraisers.`
59+
: `${emojiRegular(env, "mascot")} A new milestone has been reached! Jingle Jam ${stats.event.year} has raised ${totalRaised} so far through the Yogscast and fundraisers.`,
60+
Math.random() < 0.5
61+
? `:black_small_square: There have already been ${collections} Games Collections claimed, and our ${countFundraisers} fundraisers have raised ${totalFundraisers}!`
62+
: `:black_small_square: ${collections} Games Collections have already been claimed, and our ${countFundraisers} fundraisers have raised ${totalFundraisers}!`,
5963
"",
6064
thanks(new Date(stats.event.end), stats.event.year, env),
6165
].join("\n");

src/scheduled/summary.ts

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,28 @@ const summaryScheduled = async (
7171
const content = [
7272
`# ${emojiRegular(env, "mascot")} Jingle Jam ${stats.event.year} Day ${daysSinceLaunch} Summary`,
7373
"",
74-
`${emojiRegular(env, "happy")} ${
75-
ended ? "We" : "We've"
76-
} raised a total of ${totalRaised} for charity over the ${timeElapsed} of Jingle Jam ${
77-
stats.event.year
78-
}${ended ? "!" : " so far!"}`,
79-
`:black_small_square: There ${
80-
ended ? "were" : "have already been"
81-
} ${collections} Games Collections redeemed, and ${fundraisers} fundraisers ${
82-
ended ? "joined" : "have joined"
83-
} to raise money for charity.`,
74+
Math.random() < 0.5
75+
? `${emojiRegular(env, "happy")} ${
76+
ended ? "We" : "We've"
77+
} raised a total of ${totalRaised} for charity over the ${timeElapsed} of Jingle Jam ${
78+
stats.event.year
79+
}${ended ? "!" : " so far!"}`
80+
: `${emojiRegular(env, "happy")} ${
81+
ended ? "We" : "We've"
82+
} raised ${totalRaised} for charity in just ${timeElapsed} of Jingle Jam ${
83+
stats.event.year
84+
}!`,
85+
Math.random() < 0.5
86+
? `:black_small_square: There ${
87+
ended ? "were" : "have already been"
88+
} ${collections} Games Collections redeemed, and ${fundraisers} fundraisers ${
89+
ended ? "joined" : "have joined"
90+
} to raise money for charity.`
91+
: `:black_small_square: ${collections} Games Collections ${
92+
ended ? "were" : "have already been"
93+
} redeemed, and ${fundraisers} fundraisers ${
94+
ended ? "joined" : "have joined"
95+
} the cause.`,
8496
"",
8597
causesBreakdown(stats, env),
8698
"",

src/util/messages.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ export const thanks = (end: Date, year: number, env: Env) => {
5757

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

0 commit comments

Comments
 (0)