https://github.com/mkellerman/PSTelegramAPI
https://github.com/mkellerman/PSTelegramAPI
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mkellerman/PSTelegramAPI
- Owner: mkellerman
- Created: 2019-01-03T19:25:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T15:00:11.000Z (about 6 years ago)
- Last Synced: 2024-11-02T15:36:36.998Z (5 months ago)
- Language: PowerShell
- Size: 894 KB
- Stars: 33
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-powershell - PSTelegramAPI - Module for Telegram APIs (API Wrapper)
- my-awesome-github-stars - mkellerman/PSTelegramAPI - (PowerShell)
README
[](https://www.powershellgallery.com/packages/PSTelegramAPI/)
[](https://www.powershellgallery.com/packages/PSTelegramAPI/)[](https://dev.azure.com/mkellerman/PSTelegramAPI/_build?definitionId=3)
[](https://github.com/mkellerman)# PSTelegramAPI
PowerShell Module for Telegram APIs
# Install PSTelegramAPI from PSGallery
```powershell
Install-Module PSTelegramAPI -Scope CurrentUser
```# Examples
```powershell
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
* [PSTelegramAPI](https://www.powershellgallery.com/packages/PSTelegramAPI/) : PowerShell Gallery
* [TLSharp](https://github.com/sochix/TLSharp) : Telegram client library implemented in C#