HTTP 400 · Bad Request
CHAT_ADMIN_INVITE_REQUIRED
You do not have the rights to do this.
HTTP 400
Permissions / Forbidden
When & why it happens
You do not have the rights to do this. 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 == "CHAT_ADMIN_INVITE_REQUIRED" {
// handle this error
}
}
Related errors
ADMIN_ID_INVALIDThe specified admin ID is invalid.ADMIN_RANK_EMOJI_NOT_ALLOWEDAn admin rank cannot contain emojis.ADMIN_RANK_INVALIDThe specified admin rank is invalid.ADMIN_RIGHTS_EMPTYThe admin rights configuration has no rights set.BROADCAST_FORBIDDENChannel poll voters and reactions cannot be fetched to prevent deanonymization.BROADCAST_PUBLIC_VOTERS_FORBIDDENYou can't forward polls with public voters.BUTTON_USER_PRIVACY_RESTRICTEDThe privacy setting of the user specified in the button do not allow creating such a button.CHANNEL_BANNEDThe channel is banned.CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.CHAT_FORBIDDENYou cannot write in this chat.CHAT_FORWARDS_RESTRICTEDYou can't forward messages from a protected chat.CHAT_GUEST_SEND_FORBIDDENYou must join the discussion group before commenting.