Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkellerman/PSTelegramAPI
https://github.com/mkellerman/PSTelegramAPI
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mkellerman/PSTelegramAPI
- Owner: mkellerman
- Created: 2019-01-03T19:25:29.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T15:00:11.000Z (almost 6 years ago)
- Last Synced: 2024-08-02T07:09:50.964Z (5 months ago)
- Language: PowerShell
- Size: 894 KB
- Stars: 32
- 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
[![PSGallery Version](https://img.shields.io/powershellgallery/v/PSTelegramAPI.svg?style=for-the-badge&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/PSTelegramAPI/)
[![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/PSTelegramAPI.svg?style=for-the-badge&label=Downloads)](https://www.powershellgallery.com/packages/PSTelegramAPI/)[![Azure Pipeline](https://img.shields.io/azure-devops/build/mkellerman/PSTelegramAPI/3.svg?style=for-the-badge&label=Azure%20Pipeline)](https://dev.azure.com/mkellerman/PSTelegramAPI/_build?definitionId=3)
[![Analytics](https://ga-beacon.appspot.com/UA-133882862-1/PSTelegramAPI?pixel)](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#