feat: sync bot rich messages and inline menus
This commit is contained in:
parent
2965f5d47d
commit
1a2d03f529
24 changed files with 2073 additions and 38 deletions
29
internal/domain/botapi_rich_message.go
Normal file
29
internal/domain/botapi_rich_message.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package domain
|
||||
|
||||
// BotAPIRichMessageInput is the protocol-neutral HTTP Bot API input passed to
|
||||
// the RPC edge. Exactly one of HTML, Markdown, or BlocksJSON must be present.
|
||||
// BlocksJSON and MediaJSON are retained in the DTO so unsupported Bot API 10.2
|
||||
// shapes are rejected explicitly at the conversion boundary instead of being
|
||||
// flattened or silently dropped.
|
||||
type BotAPIRichMessageInput struct {
|
||||
HTML string
|
||||
Markdown string
|
||||
BlocksJSON []byte
|
||||
MediaJSON []byte
|
||||
RTL bool
|
||||
SkipEntityDetection bool
|
||||
}
|
||||
|
||||
func (m BotAPIRichMessageInput) SourceCount() int {
|
||||
n := 0
|
||||
if m.HTML != "" {
|
||||
n++
|
||||
}
|
||||
if m.Markdown != "" {
|
||||
n++
|
||||
}
|
||||
if len(m.BlocksJSON) != 0 {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue