wip: add long message helpers and payload type controls
- add centralized message validation errors - switch command handlers to return error - add explicit long plain-text reply helpers - support strict payload type policy with debug logging - document versioning and changelog workflow
This commit is contained in:
+10
-2
@@ -136,14 +136,22 @@ func NewInlineKeyboard(payloadType BotPayloadType, maxRow int) *InlineKeyboard {
|
||||
}
|
||||
}
|
||||
|
||||
// SetPayloadType sets the serialization format for callback data added via
|
||||
// SetPayloadType sets the keyboard-local serialization format for callback data added via
|
||||
// AddCallbackButton and AddCallbackButtonStyle methods.
|
||||
// It should be one of BotPayloadJson or BotPayloadBase64.
|
||||
// It overrides the bot's default payload type for this keyboard only.
|
||||
func (in *InlineKeyboard) SetPayloadType(t BotPayloadType) *InlineKeyboard {
|
||||
in.payloadType = t
|
||||
return in
|
||||
}
|
||||
|
||||
// GetPayloadType returns the keyboard-local callback payload encoding type.
|
||||
func (in *InlineKeyboard) GetPayloadType() BotPayloadType { return in.payloadType }
|
||||
|
||||
func (in *InlineKeyboard) SetMaxRow(maxRow int) *InlineKeyboard {
|
||||
in.maxRow = maxRow
|
||||
return in
|
||||
}
|
||||
|
||||
// Internal helper that appends a button and auto-flushes a full row.
|
||||
func (in *InlineKeyboard) append(button tgapi.InlineKeyboardButton) *InlineKeyboard {
|
||||
if in.CurrentLine.Len() == in.maxRow {
|
||||
|
||||
Reference in New Issue
Block a user