• Stars
    star
    28
  • Rank 853,615 (Top 18 %)
  • Language
    PowerShell
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PSGallery Version PSGallery Downloads

Azure Pipeline Analytics

PSTelegramAPI

PowerShell Module for Telegram APIs

Install PSTelegramAPI from PSGallery

Install-Module PSTelegramAPI -Scope CurrentUser

Examples

Import-Module PSTelegramAPI

# Establish connection to Telegram
$TLClient = New-TLClient -apiId $ENV:TLApiId -apiHash $ENV:TLApiHash -phoneNumber $ENV:TLPhoneNumber

# Get List of User Dialogs
$TLUserDialogs = Get-TLUserDialogs -TLClient $TLClient

# Get latest 100 messages from each User in List
ForEach ($User in $TLUserDialog) {
    $TLHistory = Get-TLHistory -TLClient $TLClient -Peer $User.Peer -Limit 100
}

# Find a specific User
$TLPeer = $TLUserDialogs.Where({ $_.Peer.Username -eq 'mkellerman' }).Peer

# Send message to User
Invoke-TLSendMessage -TLClient $TLClient -TLPeer $TLPeer -Message 'Hello World'

Completed

  • Get-TLUserDialogs
  • Get-TLContacts
  • Get-TLHistory
  • Invoke-TLSendMessage

References