add api scripts and telegram modules

This commit is contained in:
Alex Kup 2023-11-03 16:25:24 +03:00 committed by GitHub
parent f63b143a7e
commit bcae4dfa7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 310 additions and 0 deletions

View file

@ -0,0 +1,14 @@
function Send-ToTelegram {
param (
[Parameter(Mandatory = $True)]$Text,
$token = "687...:AAF...",
$chat = "125468108"
)
$endpoint = "sendMessage"
$url = "https://api.telegram.org/bot$token/$endpoint"
$Body = @{
chat_id = $Chat
text = $Text
}
Invoke-RestMethod -Uri $url -Body $Body
}