HTTP 403 · Forbidden
HTTP 403 Permissions / Forbidden

When & why it happens

The privacy setting of the user specified in the button do not allow creating such a button. 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 == "BUTTON_USER_PRIVACY_RESTRICTED" { // handle this error } }