teddziuba/hubot — Issue #8: Preventing multi-line output sent as text (conditionally?)
Author: tomkersten
Created: 2011-12-07 15:19:54+00:00
State: open

If a script outputs multiple lines, it is all sent up as one message. In Campfire, this results in the output being "pasted" into the session...and text is not "auto-hyperlinked."

An example: We have a simple bot to look for ticket numbers and auto-pull in the subject, project name, and generate a link to the issue. In the event that we list multiple ticket numbers in a string, the content is sent up as 3 lines of text...and the links to the tickets don't work.

I'm wondering if there is interest in making it possible to send "separate" messages for each newline contained in the output. If so, what would the preferred approach be?

A thought: defining that "adapters" must support messages with a single starting line of "SEPARATE_INPUTS." In the event that the adapter receives this, and only this, as the first line of input, it splits on line breaks and pipes each line as a separate string to the $SAY command.

I'd be interested in hearing feedback on the idea...and approach...