Offer to automatically attach text file to chat when message is too long

Sometimes (actually, often) developers need to share some piece of code or a log or something.
The most obvious way to share such information would be to paste this information in a chat to share it with one or more people although, admittedly, it makes chats very messy and unreadable.
I noticed that when I tried to paste a list with 100 lines (or some similar long text) into RC, it stopped me from posting it, saying the message is too long.

It would be nice, in such instances, if Rocket.Chat offers to create a text file attachment from the data pasted.