v1.0.0 beta 21

This commit is contained in:
2026-03-16 10:39:33 +03:00
parent fb81bb91bd
commit 389ec9f9d7
8 changed files with 125 additions and 86 deletions

View File

@@ -391,6 +391,9 @@ func (ctx *MsgContext) NewDraft() *Draft {
return ctx.newDraft(tgapi.ParseNone)
}
// NewDraftMarkdown creates a new message draft associated with the current chat,
// with Markdown V2 parse mode enabled.
// Uses the API limiter to avoid rate limiting.
func (ctx *MsgContext) NewDraftMarkdown() *Draft {
return ctx.newDraft(tgapi.ParseMDV2)
}
@@ -404,3 +407,9 @@ func (ctx *MsgContext) Translate(key string) string {
lang := Val(ctx.From.LanguageCode, ctx.l10n.GetFallbackLanguage())
return ctx.l10n.Translate(lang, key)
}
// NewInlineKeyboard creates a new keyboard builder with the context's payload
// encoding type and the specified maximum number of buttons per row.
func (ctx *MsgContext) NewInlineKeyboard(maxRow int) *InlineKeyboard {
return NewInlineKeyboard(ctx.payloadType, maxRow)
}