v0.0.612 fix sender-name in scn package
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m33s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m33s
This commit is contained in:
13
scn/send.go
13
scn/send.go
@@ -3,12 +3,13 @@ package scn
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||
json "git.blackforestbytes.com/BlackForestBytes/goext/gojson"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||
json "git.blackforestbytes.com/BlackForestBytes/goext/gojson"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -53,6 +54,10 @@ func (c *Connection) Message(title string) *MessageBuilder {
|
||||
return &MessageBuilder{conn: c, title: title}
|
||||
}
|
||||
|
||||
func (c *Connection) Title(title string) *MessageBuilder {
|
||||
return &MessageBuilder{conn: c, title: title}
|
||||
}
|
||||
|
||||
func (c *MessageBuilder) Channel(channel string) *MessageBuilder {
|
||||
c.channel = &channel
|
||||
return c
|
||||
@@ -97,7 +102,7 @@ func (c *MessageBuilder) Send(ctx context.Context) (MessageResponse, error) {
|
||||
}
|
||||
|
||||
if c.sendername != nil {
|
||||
body["content"] = *c.sendername
|
||||
body["sender_name"] = *c.sendername
|
||||
}
|
||||
|
||||
if c.time != nil {
|
||||
|
||||
@@ -11,7 +11,7 @@ func TestSendSCN(t *testing.T) {
|
||||
return
|
||||
|
||||
mr, err := New("TODO", "TODO").
|
||||
Message("Hello Test").
|
||||
Title("Hello Test").
|
||||
Content("This is a test / goext").
|
||||
Send(context.Background())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user