MCPcopy
hub / github.com/ericciarla/trendFinder / sendDraftToSlack

Function sendDraftToSlack

src/services/sendDraft.ts:28–47  ·  view source on GitHub ↗
(draft_post: string)

Source from the content-addressed store, hash-verified

26}
27
28async function sendDraftToSlack(draft_post: string) {
29 try {
30 const response = await axios.post(
31 process.env.SLACK_WEBHOOK_URL || '',
32 {
33 text: draft_post,
34 },
35 {
36 headers: {
37 'Content-Type': 'application/json',
38 },
39 }
40 );
41
42 return `Success sending draft to webhook at ${new Date().toISOString()}`;
43 } catch (error) {
44 console.log('error sending draft to webhook');
45 console.log(error);
46 }
47}
48
49export async function sendDraft(draft_post: string) {
50 const notificationDriver = process.env.NOTIFICATION_DRIVER?.toLowerCase();

Callers 1

sendDraftFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected