Created
July 9, 2023 14:54
-
-
Save hrishikeshps/927d60948f72b09476ad4e8bfeabbd29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const joinSlackChannel = (channel, message = null) => { | |
return new Promise(async (resolve, reject) => { | |
try { | |
const resp = await web.conversations.join({ | |
channel: channel, | |
}); | |
if (message) { | |
await sendSlackMessage(message, channel); | |
} | |
return resolve(true); | |
} catch (error) { | |
return resolve(true); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment