PS-Commands/Scripts/Send-ToTelegram.psm1
2023-11-03 16:25:24 +03:00

14 lines
No EOL
311 B
PowerShell

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
}