Skip to content

Peer Resolution

mtgo-cli accepts multiple peer formats in any command that needs a peer argument:

InputExampleResolution
@username@durovPublic username lookup
Phone+1234567890Contact lookup
me / selfmeCurrent user
Numeric ID123456789Auto-detected as user/chat
Explicitchannel:1234Forced channel type

Resolve Peer

Get detailed access info for a peer:

bash
mtgo-cli resolve-peer @username
mtgo-cli resolve-peer @username --format json

Usage in Commands

bash
mtgo-cli get-user @durov
mtgo-cli send-message me "Hello self"
mtgo-cli get-chat channel:123456
mtgo-cli send-photo +1234567890 photo.jpg "From CLI"

Performance Tips

  • Resolve peers once with resolve-peer, then use numeric IDs in subsequent calls
  • Commands like send-message, get-user, and get-chat bypass JSON and use the Go API directly — prefer them over raw invoke for precision with access_hash values

Released under the Apache-2.0 License.