chore: move notification test, other refactoring (#111)

This commit is contained in:
Jef LeCompte
2020-09-20 13:18:32 -04:00
committed by GitHub
parent a3fc07daf0
commit 2a1f15041e
13 changed files with 40 additions and 32 deletions
+3 -3
View File
@@ -6,16 +6,16 @@ const channel = Config.notifications.slack.channel;
const token = Config.notifications.slack.token;
const web = new WebClient(token);
export function sendSlackMessage(text: string) {
export function sendSlackMessage(cartUrl: string) {
(async () => {
try {
const result = await web.chat.postMessage({text, channel});
const result = await web.chat.postMessage({text: cartUrl, channel});
if (!result.ok) {
Logger.error(result.error);
return;
}
Logger.info(` slack message sent to '${channel}': ${text}`);
Logger.info(` slack message sent to '${channel}': ${cartUrl}`);
} catch (error) {
Logger.error(error);
}