СС
Size: a a a
СС
КТ
КТ
КТ
ИМ
DM
AM
КТ
КТ
$id = "ID берем у этого бота https://t.me/chatid_echo_bot"
$bot_token = "API содаем и берем от сюда https://t.me/botfather"
do {
$message = gc "$env:USERPROFILE\.chia\mainnet\log\debug.log" | Select-String -Pattern '(?<!\s0\s)plots were eligible for farming' | Select-Object -Last 1
$message -match "(.*) harvester .*(\d) plots .* farming (.*)\.\.\. Found (\d) .*me: (.*) s\. Total (.*) plots"
$plottime = [datetime]::ParseExact($Matches.1, "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fff", $null)
$now = (Get-Date).AddSeconds(-5)
if($plottime -gt $now)
{
$time = $Matches.5 -as [float]
if($time -gt 5)
{
$status = '🔴'
} elseif($time -gt 1) {
$status = '🟡'
} else {
$status = '🟢'
}
if ($Matches.4 -gt 0)
{
$status = '✔️'
}
$text = $status + ' 🌱 ' + $Matches.2 + ' / ' + $Matches.6 + ' 🔍 ' + $Matches.4 + ' ⏱ ' + $Matches.5
$uri = "https://api.telegram.org/bot$bot_token/sendMessage"
Invoke-WebRequest -Method Post -Uri $uri -ContentType "application/json;charset=utf-8" `
-Body (ConvertTo-Json -Compress -InputObject @{chat_id=$id; text=$text})
}
} until (Start-Sleep -Seconds 5)
КТ
КТ
КТ
VP
КТ
VP
d
КТ
КТ
КТ