Disabled VK link parsing

This commit is contained in:
Artyom Belousov 2021-06-05 10:48:13 +03:00
parent 038ca04548
commit 8a81dd4b3e
2 changed files with 9 additions and 6 deletions

View file

@ -39,6 +39,7 @@ func (s *ApiSender) send(userId int64, message string) {
"message=" + url.QueryEscape(message), "message=" + url.QueryEscape(message),
"v=5.95", "v=5.95",
"random_id=" + strconv.FormatInt(randomId, 10), "random_id=" + strconv.FormatInt(randomId, 10),
"dont_parse_links=1",
} }
joined := strings.Join(params, "&") joined := strings.Join(params, "&")
reqUrl := sendMessageUrl + "?" + joined reqUrl := sendMessageUrl + "?" + joined

View file

@ -2,12 +2,13 @@ package vk
import ( import (
"bytes" "bytes"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
"log" "log"
"net/http" "net/http"
"strings" "strings"
"testing" "testing"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
) )
func TestApiSender_Send_OK(t *testing.T) { func TestApiSender_Send_OK(t *testing.T) {
@ -19,6 +20,7 @@ func TestApiSender_Send_OK(t *testing.T) {
"peer_id": "1", "peer_id": "1",
"message": "msg", "message": "msg",
"v": "5.95", "v": "5.95",
"dont_parse_links": "1",
}, },
).ParamPresent("random_id").Reply(http.StatusOK) ).ParamPresent("random_id").Reply(http.StatusOK)