I am currently building a Slack Bot using Node JS to consume my Rails API.
I'd love to give Slack users who use the bot the option to view detailed help when they put in certain keywords.
Currently, my code looks like this:
var msg = "To edit a task, specify its alias and include the edit flag (--e). \r\n \
Then every other option you provide would replace existing ones. \r\n \
\r\n \
For example, \r\n \
\r\n \
```task send freckle reminders to me --e --t 10:00am --a freckle``` \r\n \
\r\n \
changes an existing task with alias 'freckle' to: \r\n \
``` \r\n \
task: send freckle reminders to me \r\n \
time: 10:00am
```
" + dmAuthor;
You may choose to ignore the \r\n
part, since Slack wouldn't give me any other option to break text.
My main issue is with the javascript backslash escape as my best resort (at least that's what this blog claims.
Is there any better way I could handle large texts (something similar to pHp's HEREDOC block) ?