v0.0.612 fix sender-name in scn package
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m33s

This commit is contained in:
2025-11-02 23:14:31 +01:00
parent 995a82d90a
commit b439b95f83
5 changed files with 30 additions and 13 deletions

View File

@@ -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 {

View File

@@ -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())