Добавлены уведомления о релизной сборке в Telegram

This commit is contained in:
2026-04-11 18:23:49 +03:00
parent fe8c50ff80
commit d17bd723e3
2 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$BotToken,
[Parameter(Mandatory = $true)]
[string]$ChatId,
[Parameter(Mandatory = $true)]
[string]$ThreadId,
[Parameter(Mandatory = $true)]
[string]$Text,
[switch]$DisableNotification
)
$ErrorActionPreference = "Stop"
$normalizedText = $Text.
Replace("``r``n", "`r`n").
Replace("``n", "`n").
Replace("%0A", "`n")
$body = @{
chat_id = $ChatId
message_thread_id = $ThreadId
parse_mode = "HTML"
text = $normalizedText
}
if ($DisableNotification) {
$body.disable_notification = "true"
}
Invoke-RestMethod `
-Method Post `
-Uri ("https://api.telegram.org/bot{0}/sendMessage" -f $BotToken) `
-Body $body | Out-Null