HTTP 400 · Bad Request
HTTP 400 Payments / Stars

When & why it happens

A payment, premium, or stars-purchase precondition failed. The user must complete the relevant purchase/auth flow first.

Handling in gogram

Surfaced as *gogram.ErrResponseCode. Match on the message:

if err, ok := err.(*gogram.ErrResponseCode); ok { if err.Message == "PREMIUM_CURRENTLY_UNAVAILABLE" { // handle this error } }