- slack: wrap multiline in codeblock

- version bump to 1.0.4
This commit is contained in:
Flummi 2019-12-04 06:43:25 +01:00
parent d948f7f582
commit f18d318334
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "cuffeo",
"version": "1.0.3",
"version": "1.0.4",
"description": "A multi-protocol chatbot library with nearly zero dependencies.",
"main": "src/index.mjs",
"scripts": {},

View File

@ -128,6 +128,8 @@ export default class slack extends EventEmitter {
}
async send(channel, text) {
text = Array.isArray(text) ? text.join("\n") : text;
text = text.includes("\n") ? "```" + text + "```" : text;
await this.write({
type: "message",
channel: channel,