feat: sync ephemeral transient messages
Sync telesrv 570ccf8 (feat(ephemeral): implement Layer 228 transient messages). Skipped telesrv docs changes per public sync rules; normalized the public appearance seed label.
This commit is contained in:
parent
3f78eaa2c6
commit
f49c817def
53 changed files with 5793 additions and 112 deletions
25
internal/rpc/users_bot_info_test.go
Normal file
25
internal/rpc/users_bot_info_test.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
func TestTGBotInfoPreservesEphemeralCommandMarker(t *testing.T) {
|
||||
got := tgBotInfoFromProfile(42, domain.BotProfile{
|
||||
Commands: []domain.BotCommand{
|
||||
{Command: "public", Description: "visible everywhere"},
|
||||
{Command: "private", Description: "Layer 228 only", Ephemeral: true},
|
||||
},
|
||||
}, true)
|
||||
if len(got.Commands) != 2 {
|
||||
t.Fatalf("commands = %+v, want two", got.Commands)
|
||||
}
|
||||
if got.Commands[0].Ephemeral {
|
||||
t.Fatalf("public command = %+v, want ephemeral=false", got.Commands[0])
|
||||
}
|
||||
if !got.Commands[1].Ephemeral {
|
||||
t.Fatalf("private command = %+v, want ephemeral=true", got.Commands[1])
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue