errbot icon indicating copy to clipboard operation
errbot copied to clipboard

Don't cut up words when splitting messages which are too long

Open zoni opened this issue 9 years ago • 8 comments

Errbot automatically splits a chat message up into multiple smaller messages when the original is bigger than self.bot_config.MESSAGE_SIZE_LIMIT. The current implementation is rather naive and will happily split words into two as well.

By using textwrap instead we could split messages up without doing the splitting in the middle of actual words.

zoni avatar May 15 '16 13:05 zoni

It is worse, this text is Markdown, so it cuts blocks, formatting, tables...

It needs to be a feature of the rendering.

gbin avatar May 15 '16 13:05 gbin

Any objections if I take this one?

bradstimpson avatar Oct 14 '16 02:10 bradstimpson

No objections at all. I didn't get a chance to work on this.

On Thu, Oct 13, 2016 at 7:23 PM Bradford [email protected] wrote:

Any objections if I take this one?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/errbotio/errbot/issues/754#issuecomment-253693431, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTYWD7M5pxgunqu7TpbVruBdWidMyRwks5qzue4gaJpZM4Ie1QR .

ifigotin avatar Oct 14 '16 02:10 ifigotin

The errBot.py script was removed as of 4.2.1; where is this functionality located now? Doing some grepping, there are two files with self.bot_config.MESSAGE_SIZE_LIMIT: ./backends/slack.py ./core.py

bradstimpson avatar Nov 11 '16 03:11 bradstimpson

It's in core.py now.

zoni avatar Nov 11 '16 07:11 zoni

I'm going to take a stab at fixing this.

andrewthetechie avatar Feb 18 '18 23:02 andrewthetechie

any update on this issue?

feiming avatar Apr 30 '18 04:04 feiming

I started working on this and ran into issues because of @gbin's comment - we're splitting markdown.

For just text, something like textwrap is a quick fix. Markdown is much harder.

andrewthetechie avatar Jan 12 '19 16:01 andrewthetechie