1.0.7 • Published 2 years ago
@farnaldi-dl/helpers v1.0.7
DL Helpers
This Package contains some helper functions for daily life.
Slack helper
import { SlackHelper } from "@farnaldi-dl/helpers";
const helper = new SlackHelper({
slackToken: process.env.SLACK_TOKEN,
reporterName: process.env.REPORTER_NAME,
infoChannel: process.env.SLACK_INFO_CHANNEL,
errorChannel: process.env.SLACK_INFO_CHANNEL,
});
//info message will be posted to the info channel
await helper.postInfoMessage({
message: "info",
emojiName: ":information_source:",
});
//error message will be posted to the error channel, if the error channel was not provided the message will be sent to the info channel
await helper.postErrorMessage({
message: "error",
emojiName: ":bangbang:",
});