0% found this document useful (0 votes)
30 views2 pages

Webhook Bot Status Checker Script

The document contains code to check the status of bots and send a webhook message with details every 30 seconds. It loops through all bots, counting those online and offline, totals gems, and generates a message with bot details and summaries to send via webhook.

Uploaded by

qitumbal123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Webhook Bot Status Checker Script

The document contains code to check the status of bots and send a webhook message with details every 30 seconds. It loops through all bots, counting those online and offline, totals gems, and generates a message with bot details and summaries to send via webhook.

Uploaded by

qitumbal123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Webhook_Url = "xxxx"

Webhook_MessageID = "xxxx"
Delay_Checker = 30000

-- Don't Edit --
function WebhookCheck(desc1, desc2)
local text = [[
$webHookUrl = "]]..Webhook_Url..[[/messages/]]..Webhook_MessageID..[["
$thumbnailObject = @{
url =
"https://media.discordapp.net/attachments/1068072767955685446/1147673792651464886/
Jangs.jpg?width=409&height=409"
}
$footerObject = @{
text = "]]..(os.date("!%a %b %d, %Y at %I:%M %p", os.time() + 7 * 60 *
60))..[["
}
$fieldArray = @(
@{
name = ""
value = "**]]..desc1..[[**"
inline = "true"
},
@{
name = ""
value = "**]]..desc2..[[**"
inline = "true"
}
)
$embedObject = @{
title = " **Webhook Bot Checker Jangs Lebaran**"
color = "14092287"
thumbnail = $thumbnailObject
footer = $footerObject
fields = $fieldArray
}
$embedArray = @($embedObject)
$payload = @{
embeds = $embedArray
}
[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri $webHookUrl -Body ($payload | ConvertTo-J`son -Depth
4) -Method Patch -ContentType 'application/json'
]]
local file = io.popen("powershell -command -", "w")
file:write(text)
file:close()
end

function checker()
off = 0
onl = 0
ttl = 0
gms = 0
gems= 0
desc1 = ""
desc2 = ""
for _,bot in pairs(getBots()) do
nama = "Bot : "..bot.name.."\n"
level = "Lvl : "..bot.level.."\n"
sts = "Info : "..bot.status.."\n`n"
gms = "Gems : "..bot.gems.."\n"
gms1 = bot.gems
gems = gems + gms1
ttl = ttl + 1
if bot.status ~= "online" then
off = off + 1
end
if bot.status == "online" then
onl = onl + 1
end
desc1 = desc1 .. nama .. level .. gms .. sts .. ""
end
desc2 = "\n`nTotal Online : " .. onl .. "\nTotal Offline : " .. off .. "\nTotal
Bot : " .. ttl .. "\nTotal Gems : " .. gems
return desc1, desc2
end

while true do
local desc1, desc2 = checker()

for i = Delay_Checker / 1000, 1, -1 do


local countdown = math.floor(i)
local message = "Next refresh in " .. countdown .. " seconds.\n`n" .. desc1
WebhookCheck(message, desc2)
end
end

You might also like