add api scripts and telegram modules
This commit is contained in:
parent
f63b143a7e
commit
bcae4dfa7b
8 changed files with 310 additions and 0 deletions
14
Scripts/Send-ToTelegram.psm1
Normal file
14
Scripts/Send-ToTelegram.psm1
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue