Compare commits
No commits in common. "e02ab6405d2c972a8ca202bdaecd0e1b6afefd17" and "f70c80c40e0c3af375e638690710be685f1aa213" have entirely different histories.
e02ab6405d
...
f70c80c40e
|
|
@ -24,14 +24,8 @@ func NewMessage(addreess string, token string, sender string) *Message {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *Message) Send(args ...string) error {
|
||||
var receiver, content, fingerprint string
|
||||
if len(args) == 2 {
|
||||
receiver, content = args[0], args[1]
|
||||
} else if len(args) > 2 {
|
||||
receiver, content, fingerprint = args[0], args[1], args[2]
|
||||
}
|
||||
reqUrl := fmt.Sprintf("%s/admin/message/send?sender=%s&receiver=%s&fingerprint=%s&content=%s", m.address, m.sender, receiver, fingerprint, url.QueryEscape(content))
|
||||
func (m *Message) Send(receiver, content string) error {
|
||||
reqUrl := fmt.Sprintf("%s/admin/message/send?sender=%s&receiver=%s&content=%s", m.address, m.sender, receiver, url.QueryEscape(content))
|
||||
body, err := util.HttpGet(reqUrl, map[string]string{
|
||||
"x-token": m.token,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue