MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / sendNotification

Function sendNotification

apps/web/services/slack/api/notification.ts:5–23  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

3const token = process.env.COMPANY_SLACK_BOT_TOKEN || '';
4// send notification to events-and-metrics channel
5export const sendNotification = async (message: string) => {
6 if (skipNotification()) return;
7 if (!token) {
8 console.log('no token');
9 return;
10 }
11
12 const url = 'https://slack.com/api/chat.postMessage?';
13
14 const response = await request
15 .post(
16 url +
17 'channel=events-and-metrics' +
18 `&text=${encodeURIComponent(message)}`
19 )
20 .set('Authorization', 'Bearer ' + token);
21
22 return response;
23};
24
25export function skipNotification() {
26 return process.env.SKIP_NOTIFICATION === 'true';

Callers 7

taskFunction · 0.90
handlerFunction · 0.90
removeMethod · 0.90
slackNotificationFunction · 0.90
eventSignUpFunction · 0.90
eventNewCommunityFunction · 0.90
crawlGoogleResultsFunction · 0.90

Calls 4

skipNotificationFunction · 0.85
logMethod · 0.65
setMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected