Skip to content

Commit

Permalink
Message @malted on actions
Browse files Browse the repository at this point in the history
  • Loading branch information
malted committed Feb 19, 2025
1 parent c52e5b6 commit eff8688
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ export const app = new App({

await app.start();
app.logger.info("Bolt app is running");
await app.client.chat.postEphemeral({
channel: process.env.EVENT_CHANNEL,
await app.client.chat.postMessage({
text: "Started",
user: "U03DFNYGPCN", // @Malted
channel: "U03DFNYGPCN", // @Malted
});
registerJobs();

Expand Down
8 changes: 8 additions & 0 deletions src/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,20 @@ export function registerJobs() {
channel: slack_id,
text: `_Worried sock noises_\n*Translation:* It's 6pm ${tz_label.toLowerCase()}, and you haven't coded your 15 minutes yet today! You've got until midnight tonight. Don't be a smelly sock and let your team down!`,
});
await app.client.chat.postMessage({
channel: "U03DFNYGPCN",
text: `Just warned ${slack_id} about time at 6pm (well actually ${userTime.toISOString()}). Mins coded today: ${minsCodedToday}`,
});
} else if (
userTime.getUTCHours() === 23 &&
userTime.getUTCMinutes() === 59 &&
minsCodedToday < 15 &&
!clan_failed_at
) {
await app.client.chat.postMessage({
channel: "U03DFNYGPCN",
text: `Failing user ${slack_id} for only coding ${minsCodedToday} minutes today. It's ${userTime.toISOString()}.`,
});
console.log(`${slack_id} lost, failing them...`);
// Lost the day
await sql`update clans set failed_at = ${userTime.toISOString()} where id = ${clan_id}`;
Expand Down

0 comments on commit eff8688

Please sign in to comment.