Skip to content

Commit

Permalink
fix: Dirty fix for VK's 4096-symbol message limit
Browse files Browse the repository at this point in the history
  • Loading branch information
alphatoasterous committed Jul 13, 2024
1 parent 2317953 commit aaf36c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api_utils/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ func CreateMessageSendBuilderByPost(post object.WallWallpost) *params.MessagesSe

// CreateMessageSendBuilderText creates a simple message send builder with text content.
func CreateMessageSendBuilderText(text string) *params.MessagesSendBuilder {

// TODO: Rework this and entire messaging routine altogether by segmenting text into array of messages if needed
VK_MESSAGE_LIMIT := 4096
if len(text) > VK_MESSAGE_LIMIT {
text = text[:VK_MESSAGE_LIMIT-3] + "..."
}
msg := params.NewMessagesSendBuilder()
msg.Message(text)
msg.RandomID(RandomId)
Expand Down

0 comments on commit aaf36c7

Please sign in to comment.