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

How to make discord webhook show only one person?

Asked by
v_Lzke 0
4 years ago
Edited 4 years ago

Hello, i have this webhook which shows completions of an obby, it works but the only problem is that if someone beat the obby then instead of saying they beat the obby in discord. it will send a message for everyone in the server.

Here is how this works I have a script named TouchyScript (which is in StarterPlayerScripts) which gets a response from a FilteringFunction (which is in Replicated Storage) which will then go to a script called Server Handler (in ServerScriptService) which will display a message in the discord that a person has beaten the obby

here are the scripts

TouchyScript : ps : game.Workspace.["ToE Winpad"].Part is the part that the player touchs for the message to be sent.

local part = game.Workspace["ToE Winpad"].Part
local debounce = false

function onTouched()
    if not debounce then
        debounce = true
        local response = game.ReplicatedStorage.FilteringFunction:InvokeServer()
        wait(1.5)
        debounce = false
    end

end

part.Touched:connect(onTouched) 

Server Handler :

local webhook = "https://discordapp.com/api/webhooks/638715706694828055/wkouBmQAhXH8gdNpe1stXffg6o5hXAy7130J_xhW_yBGRpdcSp-021wD66kIwFOB"
local filteringFunction = game.ReplicatedStorage.FilteringFunction
local HTTP = game:GetService("HttpService")



function filteringFunction.OnServerInvoke(player, msg)
    local payload = HTTP:JSONEncode({
        content = player.name.." Has Beaten Tower of Easiness",
        username = player.Name;
        avatar_url = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userId="..player.UserId

    })

    HTTP:PostAsync(webhook, payload)
    return "Feedback recieved!"
end

If you need more information please ask,

all answers are extremely appriciated.

0
If you only want certain people to see it, you could just make a webhook in a private channel... if you've looked at the parameters allowed for a webhook you'd see you cant send it only to a certain person. SerpentineKing 3885 — 4y
0
Why would you leak your webhook.. VitroxVox 884 — 4y
0
And why not just use a bindble function? VitroxVox 884 — 4y
0
i tried this but it seem not to work for me i put everything by the name and the same script i only changed the webhok. what should i do? boomer_sign 0 — 3y

Answer this question