Comments (15)
As far as I can see - there is no pastes feature at all(or at least it doesn't work on android)
But def. π
from hubot-slack.
Was there every any resolution for this? Is there a way to send richly formatted messages?
from hubot-slack.
I don't think I understand the issue. We use hubot commands that send multi line messages. They act the way I'd expect...a message appears with multiple lines. Is that not how it works for others?
Is a "paste" a special kind of thing?
from hubot-slack.
A tactic I've been trying has been to copy scripts out of hubot-scripts and
bring them into my scripts tree and then modify them when the out of box
script doesn't quite fit with slack.
Then you're able to do the logic for converting for display at that level,
rather than the adapter.
On Sat, Jun 14, 2014 at 7:25 PM, Evan Solomon [email protected]
wrote:
I don't think I understand the issue. We use hubot commands that send
multi line messages. They act the way I'd expect...a message appears with
multiple lines. Is that not how it works for others?Is a "paste" a special kind of thing?
β
Reply to this email directly or view it on GitHub
#17 (comment)
.
from hubot-slack.
@evansolomon in campfire you can paste and it preserves simple text formatting.
I'm gonna try to send tables of info back with #32. Not sure if I can do that or not.
from hubot-slack.
The challenge here is that Slack's servers don't work the same way Campfire does... Slack doesn't have the concept of "pastes".
We could fake this support inside hubot-slack (either by creating a Slack snippet, or by using Slack's built in message formatting) but I'm worried doing that would break scripts for people that are happily using our existing multiline message support (like, for example, Evan above).
Is there still demand for this functionality?
from hubot-slack.
It definitely makes interoperating with scripts that were created with campfire in mind less pleasant to use from Slack.
It definitely could help if hubot got a little bit more of an explicit API for "chunks of text that should be formatted with a fixed width font and possibly collapsed".
from hubot-slack.
[cc @technicalpickles to see if he has any ideas]
from hubot-slack.
This is a tough one. Hubot has historically been pretty campfire centric, so in most cases that I've written community scripts, it's assumed that if you send
a string with newlines, it will come out as a paste. If you need to send multiple messages, you can call send
with multiple arguments.
We could fake this support inside hubot-slack (either by creating a Slack snippet, or by using Slack's built in message formatting
I think creating snippets seems most analogous with pastes, which make a lot of sense to me. I don't think the builtin message formatting would work out as well, because most off the shelf scripts probably won't be expecting to be formated in anyway, just pasting.
I'm worried doing that would break scripts for people that are happily using our existing multiline message support (like, for example, Evan above).
That is going to be a problem for sure. I don't think there's a way to know how many people are using off the shelf scripts and it's sending multi-line text as multiple message, versus people creating their own versions that customize it, and I can't think of a good way to determine that. That said, my gut says there's less people doing the latter, so sending multiline text as a snippet would make sense for more people getting started, in addition to being easier for people transitioning from hubots running on Campfire.
It definitely could help if hubot got a little bit more of an explicit API for "chunks of text that should be formatted with a fixed width font and possibly collapsed".
I could see that possibility too. But it's a change to the API, which would take time for people to transition their scripts to, as well as updating their bot to a version with it.
On the plus side, it might be nice for the IRC adapter, as while it doesn't have any native way to paste text, could use a pastebin or gist type thing under the hood.
from hubot-slack.
Just checking in on this. Are snippets supported at this time?
from hubot-slack.
Another option: when multiple lines are detected, wrap it up in an attachment using customMessage
. Attachments only show the first 5 lines by default, so that'd prevent flooding.
from hubot-slack.
I put a fix for this together over at #235 if anyone wants to try it.
Are snippets supported at this time?
Worth noting that snippets are just file uploads under the hood, and as talked about in #62, files.upload isn't supported for bot users.
from hubot-slack.
#62 has since been updated that files.upload
is now supported for bot users. Just FYI π
from hubot-slack.
I'm of two minds about this. On one hand, a message with line breaks in it is a perfectly valid messageβon the other, as has been noted, it is different behavior from what is often expected. What if we included an optional flag to indicate that a message should instead be uploaded as a snippet? I'm not entirely in love with this idea, but I am very reluctant to change the default behavior.
from hubot-slack.
I'm closing this because I doesn't seem like something we're going to take on. It seems to be a hot topic (a year ago), so if folks still feel strongly about it, let's discuss in a PR on how it might work. Thanks!
from hubot-slack.
Related Issues (20)
- Get the last reply in a thread HOT 4
- @slack/client is no longer developed, and its dependency "ws" has a security vulnerability HOT 2
- Replace RTM API with Event API for hubot slack adapter HOT 5
- Change the default settings to "useRtmConnect: true"
- Hubot failing to set up with error: Response not OK: method_deprecated HOT 4
- Problem setting up slack token HOT 4
- @slack/client dependency "async" has a security vulnerability HOT 2
- Best Interior Designers in Noida
- Can not trigger listener sometimes. HOT 6
- After SlackClient#send(), I can not receive message sometimes HOT 5
- DEBUG Received file_shared message from: undefined, file_id: F03PMLTMBNE HOT 4
- How to HOT 1
- unable to get response from hubot HOT 3
- App user who is initiating action is identified as channel instead of App name HOT 5
- Port hubot-slack away from @slack/client? HOT 2
- Rtm.start not getting replaced by rtm.connect HOT 6
- slack bot respond only once in the thread message HOT 3
- RTMClient failed to connect HOT 15
- hubot@>4.0.0 Cannot load adapter HOT 11
- Deleted Message Event HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubot-slack.