feat(tgapi): add context-aware API/uploader methods and align params/docs with Telegram Bot API
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package tgapi
|
||||
|
||||
import "context"
|
||||
|
||||
// SetPassportDataErrorsP holds parameters for the setPassportDataErrors method.
|
||||
// See https://core.telegram.org/bots/api#setpassportdataerrors
|
||||
type SetPassportDataErrorsP struct {
|
||||
@@ -14,3 +16,11 @@ func (api *API) SetPassportDataErrors(params SetPassportDataErrorsP) (bool, erro
|
||||
req := NewRequest[bool]("setPassportDataErrors", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
|
||||
// SetPassportDataErrorsWithContext is the context-aware variant of SetPassportDataErrors.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setpassportdataerrors
|
||||
func (api *API) SetPassportDataErrorsWithContext(ctx context.Context, params SetPassportDataErrorsP) (bool, error) {
|
||||
req := NewRequest[bool]("setPassportDataErrors", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user