HTTP 401 · Unauthorized
HTTP 401 Authentication

When & why it happens

The specified auth token is invalid. Treated by gogram as a regular API error; inspect ErrResponseCode.Message for the exact code.

Handling in gogram

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

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