From 9a12127b67b21ef30a291a98eddb00f9e660c52e Mon Sep 17 00:00:00 2001 From: Matthew Stanciu Date: Tue, 13 Apr 2021 18:59:26 -0400 Subject: [PATCH] Invite tagged user to channels on `/leader-add` (#45) --- src/interactions/leaderAdd.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/interactions/leaderAdd.js b/src/interactions/leaderAdd.js index 82c1428f..f0e9e784 100644 --- a/src/interactions/leaderAdd.js +++ b/src/interactions/leaderAdd.js @@ -36,6 +36,18 @@ const interactionLeaderAdd = async (bot, message) => { Clubs: [...taggedUserClubs, recipientClub.id], }) + // invite leader to #leaders and their club channel + bot.api.conversations.invite({ + token: bot.config.bot.access_token, + channel, + users: taggedUserID + }) + bot.api.conversations.invite({ + token: bot.config.bot.access_token, + channel: 'GAE0FFNFN', + users: taggedUserID + }) + bot.replyPrivateDelayed( message, transcript('leaderAdd.success', { taggedUserID, channel })