fix: link
This commit is contained in:
@@ -2,6 +2,7 @@ package memos
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/imroc/req/v3"
|
||||
"github.com/pkg/errors"
|
||||
@@ -40,10 +41,14 @@ func InitClient(host, token string) {
|
||||
func Post(pd PostData) error {
|
||||
var createMemoResp Memo
|
||||
|
||||
content := fmt.Sprintf("#%s #%d \n\n%s", pd.ChannelTitle, pd.ChannelID, pd.Content)
|
||||
content = strings.ReplaceAll(content, "http://", " http://")
|
||||
content = strings.ReplaceAll(content, "https://", " https://")
|
||||
|
||||
resp, err := client.R().
|
||||
SetSuccessResult(&createMemoResp).
|
||||
SetBodyJsonMarshal(Memo{
|
||||
Content: fmt.Sprintf("#%s #%d \n\n%s", pd.ChannelTitle, pd.ChannelID, pd.Content),
|
||||
Content: content,
|
||||
Visibility: "PUBLIC",
|
||||
}).
|
||||
Post("api/v1/memos")
|
||||
|
||||
Reference in New Issue
Block a user