Slack
Add a Slack model with:
$ yarn add @xomlo/xomlo-models-slack
Init the Slack object like this:
import { Slack } from "@xomlo/xomlo-models-slack";
...
const Slack = new Slack(...);
Config object
const Slack = new Slack({
token: "{my-slack-api-token}"
});
Reference:
Parameter
Type
Description
token
string
Your Slack API token which you can generate in Slack settings. More info on Slack documentation.
.sendMessage()
This method will send your message to a given channel.
Arguments:
Argument
Type
Description
channel
string
Name of the channel you want to send your message in
message
string
Your own message
Returns:
void
Last updated
Was this helpful?