NicoNex / echotron

An elegant and concurrent library for the Telegram bot API in Go.
https://t.me/s/echotronnews
GNU Lesser General Public License v3.0
372 stars 26 forks source link

3s delays #45

Closed h31p closed 5 months ago

h31p commented 5 months ago

after upgrading to v3.31.2, in absence of any changes in tg code - every bot update is now being processed with a 3 seconds delay. guess, it's because of commit 6636d2e, where request limits were introduced. the default ones seems to be too agressive, and i can't find the way to change them from userland, since web client itself (and thus even public methods of it) is unexported.

of course, reverting to v3.31.1 eliminates these 3s delays.

NicoNex commented 5 months ago

The update that will allow you to change this behaviour is on the way.

NicoNex commented 5 months ago

I've just released the version v3.31.3 that adds a way for the users to specify the rate limit.

// SetGlobalRequestLimit sets the global rate limit for requests to the Telegram API.
// A duration of 0 disables the rate limiter, allowing unlimited requests.
func SetGlobalRequestLimit(d time.Duration)

// SetChatRequestLimit sets the per-chat rate limit for requests to the Telegram API.
// A duration of 0 disables the rate limiter, allowing unlimited requests.
func SetChatRequestLimit(d time.Duration)