Exemple #1
0
func TestSendMsg(t *testing.T) {
	pkg := &pb.SendMsgTextPkg{
		ToUser:  "******",
		MsgType: "text",
		Text:    pb.TextContent{"hello body"},
	}

	err := pb.SendMsg(postURL, pkg)
	if err != nil {
		t.Fatal("SendMsg error:", err)
	}
}
Exemple #2
0
func SendMsg(accessToken string, pkg interface{}) error {
	r := strings.Join([]string{sendURL, "?access_token=", accessToken}, "")
	return pb.SendMsg(r, pkg)
}