Skip to content

Instantly share code, notes, and snippets.

@loloDawit
Created November 19, 2021 02:22
Show Gist options
  • Save loloDawit/87a0a63a54c1c818930facb7b555859b to your computer and use it in GitHub Desktop.
Save loloDawit/87a0a63a54c1c818930facb7b555859b to your computer and use it in GitHub Desktop.
Slack Format
module.exports = {
response: (color, msg, extra) => {
return {
attachments: [
{
fallback: "Fallback triggered",
color: `${color}`,
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: `${msg}`
}
},
{
type: "context",
elements: [
{
type: "mrkdwn",
text: `${extra}`
}
]
}
]
}
]
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment