Skip to content

Ability to split a message if it's too big to send in one piece#14

Open
AlexanderYAPPO wants to merge 1 commit intobot-api:masterfrom
AlexanderYAPPO:master
Open

Ability to split a message if it's too big to send in one piece#14
AlexanderYAPPO wants to merge 1 commit intobot-api:masterfrom
AlexanderYAPPO:master

Conversation

@AlexanderYAPPO
Copy link

If a message is larger than 4096 bytes telegram API doesn't accept it. I added an api call that split big messages like that to smaller pieces and them send them one by one. Every time we try to split the text by whitespace symbols if it's possible. Otherwise we simply cut a word as soon as it's size is greater than allowed size.


"github.com/bot-api/telegram"
"github.com/m0sth8/httpmock"
"github.com/jarcoal/httpmock"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find additional commits in m0sth8/httpmock fork so I decided to switch it to upstream because they have a very useful feature httpmock.GetTotalCallCount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant