Disabled VK link parsing
This commit is contained in:
parent
038ca04548
commit
8a81dd4b3e
2 changed files with 9 additions and 6 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
@ -15,10 +16,11 @@ func TestApiSender_Send_OK(t *testing.T) {
|
||||||
|
|
||||||
gock.New(sendMessageUrl).MatchParams(
|
gock.New(sendMessageUrl).MatchParams(
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"access_token": "token",
|
"access_token": "token",
|
||||||
"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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue