Documentation Index
Fetch the complete documentation index at: https://mintlify.com/danog/MadelineProto/llms.txt
Use this file to discover all available pages before exploring further.
Overview
MadelineProto provides thegetInfo method to retrieve comprehensive information about any peer (user, chat, channel, or supergroup). This method automatically handles username resolution, invite links, and various peer formats.
Basic Usage
Get Full Information
$peer parameter can be:
- Numeric ID: User ID, chat ID, or channel ID
- Username:
@usernameorusername - Invite link:
https://t.me/joinchat/... - Special strings:
me(yourself),support(Telegram support) - Arrays: Update objects or message objects
Information Types
You can request specific information by passing a type constant:Available Info Types
API::INFO_TYPE_ALL- Returns complete information (default)API::INFO_TYPE_ID- Returns the bot API ID as an integerAPI::INFO_TYPE_TYPE- Returns peer type:user,chat,channel, orsupergroupAPI::INFO_TYPE_CONSTRUCTOR- Returns the InputPeer constructorAPI::INFO_TYPE_PEER- Returns the InputPeer objectAPI::INFO_TYPE_USERNAMES- Returns array of usernames
Return Values
When usingAPI::INFO_TYPE_ALL, the method returns an array containing:
Examples
Check if Peer is a Bot
Check if Peer is a Forum
Get User by Username
Get Channel Information
Resolve Invite Link
Special Peers
Get Your Own Information
Get Telegram Support
ID Conversion
Convert to Bot API Format
Get InputPeer Constructor
Full Information
For complete peer details including description, photo, and statistics:Error Handling
Performance Considerations
The
getInfo method automatically caches peer information. If you have a large number of dialogs, consider using getDialogIds() for bots instead of fetching full information for each peer.For Bots: Get Dialog IDs
For Users: Get Full Dialogs
See Also
- Dialogs - Working with dialog lists
- Error Handling - Handling exceptions
- API Methods - Complete method documentation