Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- server.lua
- local webhookURL = "https://discord.com/api/webhooks/XXXXX/XXXXXXXX" -- Reemplaza con tu webhook
- function sendActivePlayersToWebhook()
- local players = getElementsByType("player")
- if #players == 0 then return end
- local lines = {}
- for _, player in ipairs(players) do
- table.insert(lines, "• " .. getPlayerName(player))
- end
- local message = "**Usuarios activos en el servidor:**\n" .. table.concat(lines, "\n")
- fetchRemote(webhookURL, {
- method = "POST",
- headers = { ["Content-Type"] = "application/json" },
- postData = toJSON({ content = message })
- })
- end
- setTimer(sendActivePlayersToWebhook, 3600000, 0) -- Cada 1 hora
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement