From 918629ab243a787c31d9a3bf3d86665cb270330a Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Mon, 11 Apr 2022 10:15:53 -0400 Subject: [PATCH] Add toriel invite details to /airtable command --- src/interactions/airtable.js | 3 +++ src/utils/index.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/interactions/airtable.js b/src/interactions/airtable.js index 5f4ff53..be4a8d8 100644 --- a/src/interactions/airtable.js +++ b/src/interactions/airtable.js @@ -24,6 +24,9 @@ export default async (bot, message) => { if (info.address && info.address.id) { results.addressAirtableRecord = `` } + if (info.torielInvite) { + results.torielInvite = true + } if (info.leaderV2) { results.leaderV2Record = `` results.leaderV2Status = info.leaderV2.fields['Status'] diff --git a/src/utils/index.js b/src/utils/index.js index 285a065..fb52acc 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -278,7 +278,10 @@ export const getInfoForUser = user => }), airFind('Club Leaders', 'Slack ID', user, { base: 'clubsV2' }).then(leaderV2 => { results.leaderV2 = leaderV2 - }) + }), + // @msw: see hackclub/toriel for usage + // https://github.com/hackclub/toriel/commit/d0e79852a0f200d8cae58bc3da6e1d0ae68ad946 + fetch(`https://toriel.hackclub.com/slack-tutorial/${user}`).then(r => r.json()).then(r => results.torielInvite = r.invite), ]) .then(async () => { if (!results.person && results.slackUser) {