Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Dyscord Webhook is not working?

Asked by 2 years ago

****I was trying to make a discord webhook that will send me players stats in discord, it prints everything I made, but discord webhook bot says nothing and no errors****

One of my friend said me that I should use TextFilter service but im not sure

Thank you for help!

local http = game:GetService("HttpService")

local suffixes = {'','K','M','B','T','Qa','Qi','Sx','Sp','Oc','No','Do','Ud','Dd','Td','Qua','Qui','Sxd','Spd','Ocd','Nod','Vg','Ug'}
function Format(val)
    for i=1, #suffixes do
        if tonumber(val) < 10^(i*3) then
            return math.floor(val/((10^((i-1)*3))/100))/(100)..suffixes[i]
        end
    end
end

local TextService = game:GetService("TextService")

while task.wait(15) do
    pcall(function()
        for i,player in pairs(game:GetService("Players"):GetPlayers()) do
            local Data = {
                ["Player Name: "] = player.Name,
                ["Player Stats: "] = "Tokens: "..Format(player:WaitForChild("PlayerFolder"):WaitForChild("DataFolder"):WaitForChild("Tokens").Value)..' BT: '..Format(player:WaitForChild("PlayerFolder"):WaitForChild("DataFolder"):WaitForChild("BT").Value)
            }
            print(Data)
            Data = http:JSONEncode(Data)
            print(Data)
            http:PostAsync("https://discord.com/api/webhooks/NO WEBHOOK LINK BUT ITS CORRECT", Data)
        end
    end)
end
0
i'm pretty sure discord blocked roblox http requests jochengael 0 — 2y
0
discord has indeed blocked http requests from roblox, due to players overusing the http requests to discord. it will only work in roblox studio. PaleNoobs 37 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Issue fixed.

Ad

Answer this question