Documentation
¶
Index ¶
- Variables
- func CheckDisabledCommand(command string, chatID int64) bool
- func CheckDisabledMiddleware(next bot.HandlerFunc) bot.HandlerFunc
- func EscapeHTML(s string) string
- func FileTypeByFileID(fileID string) int32
- func FormatText(text string, entities []models.MessageEntity) string
- func GetHelpKeyboard(i18n func(string, ...map[string]any) string) [][]models.InlineKeyboardButton
- func IsGroup(next bot.HandlerFunc) bot.HandlerFunc
- func RandomString(n int) string
- func Request(url string, params RequestParams) (*http.Response, error)
- func ResizeSticker(input []byte) ([]byte, error)
- func ResizeThumbnail(input []byte) ([]byte, error)
- func SanitizeString(input string) string
- func SaveHelp(name string)
- type HTTPCaller
- type RequestParams
- type RetryCaller
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHTTPCaller = &HTTPCaller{ Client: &http.Client{ Transport: &http.Transport{ MaxConnsPerHost: 1024, }, }, }
View Source
var DisableableCommands []string
View Source
var ErrMaxRetryAttempts = errors.New("max retry attempts reached")
Functions ¶
func CheckDisabledCommand ¶
func CheckDisabledMiddleware ¶
func CheckDisabledMiddleware(next bot.HandlerFunc) bot.HandlerFunc
func EscapeHTML ¶
func FileTypeByFileID ¶
func FormatText ¶
func FormatText(text string, entities []models.MessageEntity) string
func GetHelpKeyboard ¶
func IsGroup ¶
func IsGroup(next bot.HandlerFunc) bot.HandlerFunc
func RandomString ¶
func ResizeSticker ¶
func ResizeThumbnail ¶
func SanitizeString ¶
Types ¶
type HTTPCaller ¶
func (HTTPCaller) Call ¶
func (a HTTPCaller) Call(url string, params RequestParams) (*http.Response, error)
type RequestParams ¶
type RetryCaller ¶
type RetryCaller struct {
Caller *HTTPCaller
MaxAttempts int
ExponentBase float64
StartDelay time.Duration
MaxDelay time.Duration
}
func (*RetryCaller) Request ¶
func (r *RetryCaller) Request(url string, params RequestParams) (*http.Response, error)
Click to show internal directories.
Click to hide internal directories.