contacts.resolveUsername

Resolve a @username to get peer info

userEmpty#200250ba id:int = User;
userSelf#7007b451 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
---functions---
contacts.resolveUsername#bf0131c username:string = User;

Parameters

Name Type Description
flags # Flags, see TL conditional fields
username string @username to resolve
referer flags.0?string  

Result

contacts.ResolvedPeer

Possible errors

Code Type Description
400 CONNECTION_LAYER_INVALID Layer invalid.
400 USERNAME_INVALID The provided username is not valid.
400 USERNAME_NOT_OCCUPIED The provided username is not occupied.

Bots can use this method