-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from mission-apprentissage/ui-server/add-slac…
…k-support [UI - server] Ajout bot slack
- Loading branch information
Showing
11 changed files
with
1,255 additions
and
50 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { App } = require("@slack/bolt"); | ||
|
||
const config = require("../config"); | ||
|
||
const sendToSlack = async (main) => { | ||
if (!config.slack.channel) return; | ||
|
||
const slack = new App({ | ||
token: config.slack.token, | ||
signingSecret: config.slack.signingSecret ?? "", | ||
}); | ||
|
||
const sent = await slack.client.chat.postMessage({ | ||
text: "", | ||
blocks: main, | ||
channel: config.slack.channel, | ||
}); | ||
|
||
return sent.ok; | ||
}; | ||
|
||
module.exports = { | ||
sendToSlack, | ||
}; |
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
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
Oops, something went wrong.