Skip to content

Instantly share code, notes, and snippets.

@danielkhan
Created July 20, 2018 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielkhan/f6582fc134c7223bbc16adfa980ca680 to your computer and use it in GitHub Desktop.
Save danielkhan/f6582fc134c7223bbc16adfa980ca680 to your computer and use it in GitHub Desktop.
module.exports.postProblemDetail = async (body, callback) => {
console.log(body);
if (body.type === "validate") {
return callback(null, success(say("Would you like to notify the person on call?", 'Notify Daniel')));
}
if (body.type === "custom") {
return callback(null, success(say(`Notified Daniel`)));
}
if (body.type === "confirmed") {
const res = await axios.post('https://textbelt.com/text', {
phone: '+00000000000000000',
message: body.payload.problem.title,
key: '<secretkey>',
});
console.log(res);
return callback(null, success(say("Notification sent")));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment