TelegramPHP Documentation

Exceptions

Table of Contents

Classes

BadRequestException
Thrown on `400 Bad Request` - the call was malformed, or the chat, message, or file it named does not exist. Check {@see HttpException::getMigrateToChatId()}: a group that has been upgraded to a supergroup reports the new id here.
ConflictException
Thrown on `409 Conflict` - most often a webhook is active while {@see \Telegram\Api\UpdateApi::getUpdates()} is being polled, or two pollers share one token.
ForbiddenException
Thrown on `403 Forbidden` - the bot was blocked by the user, kicked from the chat, or lacks the right to take the action.
HttpException
Base for every failed Bot API call.
NotFoundException
Thrown on `404 Not Found` - no such Bot API method. Usually a typo, or a method newer than the Bot API server being called.
RequestEntityTooLargeException
Thrown on `413 Request Entity Too Large` - the uploaded file exceeds the Bot API limit (50 MB for most media on the official server).
ServerException
Thrown on `5xx` - Telegram is unavailable or failed internally. The client already retried before this surfaces.
TooManyRequestsException
Thrown on `429 Too Many Requests` after the client has exhausted its retries. {@see HttpException::getRetryAfter()} carries the cool-off Telegram asked for.
UnauthorizedException
Thrown on `401 Unauthorized` - the bot token is missing, revoked, or mistyped.
On this page

Search results