- slack: wrap multiline in codeblock
- version bump to 1.0.4
This commit is contained in:
parent
d948f7f582
commit
f18d318334
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cuffeo",
|
"name": "cuffeo",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "A multi-protocol chatbot library with nearly zero dependencies.",
|
"description": "A multi-protocol chatbot library with nearly zero dependencies.",
|
||||||
"main": "src/index.mjs",
|
"main": "src/index.mjs",
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
|
|
|
@ -128,6 +128,8 @@ export default class slack extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
async send(channel, text) {
|
async send(channel, text) {
|
||||||
|
text = Array.isArray(text) ? text.join("\n") : text;
|
||||||
|
text = text.includes("\n") ? "```" + text + "```" : text;
|
||||||
await this.write({
|
await this.write({
|
||||||
type: "message",
|
type: "message",
|
||||||
channel: channel,
|
channel: channel,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user