AppInfo Settings
TheAppInfo class configures your application’s identity and metadata when connecting to Telegram.
Overview
Properties
Your API ID from my.telegram.org
Your API hash from my.telegram.org
Device model (auto-detected from system)
System version (auto-detected from PHP)
Application version (defaults to MadelineProto version)
Language code (ISO 639-1)
System language code
Language pack name
Whether to show prompt for API credentials if not provided
Methods
setApiId
Set your Telegram API ID.API ID from my.telegram.org
Returns self for method chaining
getApiId
Get the configured API ID.The API ID
If API ID is not set
setApiHash
Set your Telegram API hash.API hash from my.telegram.org
Returns self for method chaining
getApiHash
Get the configured API hash.The API hash
If API hash is not set
hasApiInfo
Check if API credentials are configured.True if both API ID and hash are set
setDeviceModel
Set device model identifier.Device model name
Returns self for method chaining
getDeviceModel
Get the device model.Device model name
setSystemVersion
Set system version identifier.System version
Returns self for method chaining
getSystemVersion
Get the system version.System version
setAppVersion
Set application version.Application version
Returns self for method chaining
getAppVersion
Get the application version.Application version
setLangCode
Set language code.ISO 639-1 language code (e.g., ‘en’, ‘it’, ‘ru’)
Returns self for method chaining
getLangCode
Get the language code.Language code
setSystemLangCode
Set system language code.System language code
Returns self for method chaining
getSystemLangCode
Get the system language code.System language code
setLangPack
Set language pack name.Language pack identifier
Returns self for method chaining
getLangPack
Get the language pack.Language pack name
setShowPrompt
Set whether to show API credentials prompt.Whether to show prompt if credentials are missing
Returns self for method chaining
getShowPrompt
Get whether the prompt is enabled.True if prompt is enabled
Complete Example
Getting API Credentials
- Go to my.telegram.org
- Log in with your phone number
- Go to “API development tools”
- Create a new application (if you haven’t already)
- Copy your
api_idandapi_hash
Auto-Detection
Some properties are auto-detected:- Device Model: Detected via
php_uname('s')(falls back to “Web server”) - System Version: Detected via
php_uname('r')(falls back to PHP version) - Language: Detected from
HTTP_ACCEPT_LANGUAGEorLANGenvironment variable
See Also
- Connection Settings - Configure connection parameters
- Logger Settings - Configure logging
- Database Settings - Configure database backend