chat actions and file uploading; v0.3.7

This commit is contained in:
2026-02-04 11:13:26 +03:00
parent c71aad0c79
commit 913fa20e19
7 changed files with 360 additions and 29 deletions

View File

@@ -119,8 +119,8 @@ func (ctx *MsgContext) answerPhoto(photoId, text string, kb *InlineKeyboard) *An
params := &SendPhotoP{
ChatID: ctx.Msg.Chat.ID,
Caption: text,
Photo: photoId,
ParseMode: ParseMD,
Photo: photoId,
}
if kb != nil {
params.ReplyMarkup = kb.Get()
@@ -184,6 +184,15 @@ func (ctx *MsgContext) AnswerCbQueryUrl(u string) {
ctx.answerCallbackQuery(u, "", false)
}
func (ctx *MsgContext) SendAction(action ChatActions) {
_, err := ctx.Bot.SendChatAction(SendChatActionP{
ChatID: ctx.Msg.Chat.ID, Action: action,
})
if err != nil {
ctx.Bot.logger.Errorln(err)
}
}
func (ctx *MsgContext) error(err error) {
text := fmt.Sprintf(ctx.Bot.errorTemplate, EscapeMarkdown(err.Error()))