1.0.1 • Published 6 years ago
@radiateholdco/post-to-google-chatroom v1.0.1
post-to-google-chatroom
Why
So we don't have to remember message formatting when posting to Google chat.
Installation
npm install --save --save-exact @radiateholdco/post-to-google-chatroom
Usage
message
is a string or an object. If you want to send a richer message, see here.
options
is an optional object.
postToGoogleChatroom(message, options);
// no need to catch it
postToGoogleChatroom('some process succeeded.');
// chainable
postToGoogleChatroom('NPS process succeeded for Grande.')
.then(doSomethingElse);
Options and defaults
{
// function that is run if the request fails
catchFunction: (err) => { console.error(err.response.status); return err; },
// add UTC time string to beginning of text
timestamps: true,
url: process.env.GOOGLE_CHATROOM_URL,
}