(new): rich message support
(fix): runtime reliability (tests): regression coverage (doc): v1.1 release notes
This commit is contained in:
+11
-2
@@ -61,6 +61,15 @@ func (f UploaderFile) SetType(t UploaderFileType) UploaderFile {
|
||||
return f
|
||||
}
|
||||
|
||||
// SetAttachName sets the multipart field name used by an attach:// reference.
|
||||
// The name must match the suffix of the corresponding InputMedia.Media value.
|
||||
//
|
||||
// Since: Bot API 10.2
|
||||
func (f UploaderFile) SetAttachName(name string) UploaderFile {
|
||||
f.field = UploaderFileType(name)
|
||||
return f
|
||||
}
|
||||
|
||||
// Uploader is a Telegram Bot API client specialized for multipart file uploads.
|
||||
//
|
||||
// Use Uploader methods when you need to upload binary files directly
|
||||
@@ -155,7 +164,7 @@ func (r UploaderRequest[R, P]) doRequest(ctx context.Context, up *Uploader) (R,
|
||||
if err != nil {
|
||||
return zero, err
|
||||
}
|
||||
up.logger.Debugln("UPLOADER RES", url, string(body))
|
||||
up.logger.Debugln("UPLOADER RES", responseLogSummary(r.method, len(body)))
|
||||
|
||||
response, err := parseBody[R](body)
|
||||
if err != nil {
|
||||
@@ -167,7 +176,7 @@ func (r UploaderRequest[R, P]) doRequest(ctx context.Context, up *Uploader) (R,
|
||||
after := *response.Parameters.RetryAfter
|
||||
up.logger.Warnf("Rate limited, retry after %d seconds (chat: %d)", after, r.chatID)
|
||||
if up.api.Limiter != nil {
|
||||
if r.chatID > 0 {
|
||||
if r.chatID != 0 {
|
||||
up.api.Limiter.SetChatLock(r.chatID, after)
|
||||
} else {
|
||||
up.api.Limiter.SetGlobalLock(after)
|
||||
|
||||
Reference in New Issue
Block a user