Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send long messages as attachments with text #235

Closed

Conversation

technicalpickles
Copy link
Contributor

This prevents very long messages from flooding channels. It's triggered
by 700 characters or 5 lines of text. This was chosen because of the
attachment documentation at https://api.slack.com/docs/attachments saying:

The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content.

This would fix #17

This prevents very long messages from flooding channels. It's triggered
by 700 characters or 5 lines of text. This was chosen because of the
attachment documentation at https://api.slack.com/docs/attachments saying:

> The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content.
@technicalpickles
Copy link
Contributor Author

Sending multiple submessages actually ends up looking a little weird, since there's multiple "show more":

I wonder if it'd be better to just truncate, and log a warning.

I've also asked Slack support about confirming the maximum message length.

@willdurand
Copy link

Hi! Any news in this?

@technicalpickles
Copy link
Contributor Author

I haven't received any feedback on this yet. There are failing tests, and they are complex enough that I didn't want to dig into them unless this is in the right direction.

@sheluchin
Copy link

sheluchin commented May 13, 2016

I wonder if it'd be better to just truncate, and log a warning.

I don't think it would be better. That warning would say nothing about the contents of the truncated message and finding the message would be difficult after seeing a warning. The warning is basically not actionable. Attaching long messages as files seems like the most logical approach. At least that way we could see the contents of the message and act on it, if necessary. I would like to see this effort move forward.

@sheluchin
Copy link

@technicalpickles: do you know if the problem changes at all with SDK v3 introduced in #309?

@UncannyBingo
Copy link

We're looking into it @sheluchin :D

@aoberoi
Copy link
Contributor

aoberoi commented Oct 11, 2017

i don't quite understand what flooding means in this context. Slack will fold up long messages so that a single long message cannot take over the entire display. From my point of view, that is preventing flooding. It seems like this PR is meant to circumvent that folding of long messages, so it would only increase flooding.

Closing for now. If you can help me understand the problem this PR aims to solve, i'll reopen it.

@aoberoi aoberoi closed this Oct 11, 2017
@aoberoi aoberoi added the enhancement M-T: A feature request for new functionality label Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically make a send() with a "\n" be converted to a paste
5 participants