Skip to content

Commit

Permalink
Merge pull request #508 from bettersg/507-do-not-send-checkers-activi…
Browse files Browse the repository at this point in the history
…ty-reminders-after-they-have-been-onboarded

deactivate upon offboarding and save data
  • Loading branch information
sarge1989 authored Nov 11, 2024
2 parents 7894e36 + 42fbcb9 commit 1cffa03
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"NO_OUTSTANDING": "Great, you have no further messages to assess. Keep it up!💪",
"REMINDER": "<b>📍 We Miss You! 👀</b>\n\nHey {{name}}, it looks like you've been inactive for the past {{num_days}} days. Just a friendly reminder: if we don't see any activity for 7 days, your access as a checker will be temporarily deactivated.\n\nIf you need any help or have any questions, feel free to ask in the Q&A channel of our <a href='{{checkers_group_link}}'>Checker's Telegram group</a> - we're here to help! 😊",
"DEACTIVATION": "<b>📍 Temporary Deactivation Notice</b>\n\nHi {{name}},\n\nYour access as a checker has been temporarily deactivated due to inactivity. No worries though - simply press the button below to get back to checking! 🚀\n\nWe're excited to see you back in action soon 😊",
"MANAGE_OUT": "<b>📍 CheckMate Fact-checker Programme Status</b>\n\nHi {{name}},\n\nThank you so much for your time and dedication during the CheckMate programme. While you've given it your best, it seems we haven't quite met the criteria needed to continue as a volunteer in our checking crew.\n\nWe'd love to hear about your experience - your feedback will help us improve! Please take a moment to fill out this <a href='{{survey_link}}'>quick survey</a>: \n\nAs part of this process, you'll also be removed from the Checkers' Crew Telegram chat. We appreciate your understanding and wish you all the best moving forward 💛\n\nThank you for your contribution,\n\nThe CheckMate Team",
"MANAGE_OUT": "<b>📍 CheckMate Fact-checker Programme Status</b>\n\nHi {{name}},\n\nThank you so much for your time and dedication during the CheckMate programme. While you've given it your best, it seems we haven't quite met the criteria needed to continue as a volunteer in our checking crew.\n\nWe'd love to hear about your experience - your feedback will help us improve! Please take a moment to fill out this <a href='{{survey_link}}'>quick survey</a>: \n\nAs part of this process, you'll also be removed from the Checkers' Crew Telegram chat, and will not receive future messages to vote on. We appreciate your understanding and wish you all the best moving forward 💛\n\nThank you for your contribution,\n\nThe CheckMate Team",
"GRADUATION": "<b>📍 Congratulations, You've Graduated! 🎉</b>\n\nHi {{name}},\n\nHuge congratulations on completing the CheckMate checkers' programme! You've worked hard, and completed the following:\n\nNo. of messages voted on: {{num_messages}}\nAccuracy: {{accuracy}}\nNo. of new users referred: {{num_referred}}\nNo. of messages reported: {{num_reported}}\n\nYour dedication has clearly paid off! 🎓\n\nWe'd love to hear about your experience - please take a moment to fill out <a href='{{survey_link}}'>our survey</a>\n\nTo generate your official completion certificate, just press the button below.\n\nThank you for being part of the Checkers' Crew. We're so proud of you! 💪",
"WELCOME": "<b>📍 Welcome to the Checkers' Crew! 👋</b>\n\nLet's welcome our new checkers!🎉\n\n{{names}}\n\nWe're so excited to have you join our fact-checking family. This group is your hub for connecting with fellow Checkers, sharing tips, and staying up to date with important updates.\n\nIf you ever feel unsure about anything, don't hesitate to reach out or ask in our Q&A channel. We're all here to support each other and improve our skills together 🤗\n\nLet's get started!"
}
6 changes: 6 additions & 0 deletions functions/src/definitions/taskHandlers/reactivations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export const sendCheckerReactivation = onTaskDispatched(
logger.error(`Checker ${checkerId} not found`)
return
}
if (checkerDocSnap.get("offboardingTime") != null) {
logger.info(
`Checker ${checkerId} has been offboarded. Stopping reactivation attempts.`
)
return
}
const reactivationCheckResponse = await checkCheckerActivity(
checkerDocSnap,
cumulativeDelaySeconds
Expand Down
5 changes: 5 additions & 0 deletions functions/src/services/checker/managementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export async function offboardChecker(checkerDocSnap: DocumentSnapshot) {
)
//call Telegram API to kick checker from group
await adminBot.telegram.unbanChatMember(CHECKERS_CHAT_ID, telegramId)
await checkerDocSnap.ref.update({
isActive: false,
offboardingTime: Timestamp.now(),
onboardingStatus: "offboarded",
})
return ServiceResponse.success({
message: "Checker expelled",
})
Expand Down

0 comments on commit 1cffa03

Please sign in to comment.