Discord Webhook Issues

For some reason, my webhook is not posting no matter what I set the content to. Everything I tried has failed, and I’m getting no errors in output. This is located inside the Basic Admin Module pretty far down inside of one of the functions.

local Data = {
   ["content"] = "hi"
}

local HTTP = game:GetService("HttpService")
local webhook = "https://discordapp.com/api/webhooks/private"
HTTP:PostAsync(webhook, HTTP:JSONEncode(Data))

Try to execute that without BA and say is it work?

Yes. I put it in its own script and it worked fine.

use print before sending POST request to webhook in BA module and say is it work or no?

I sure function in BA Module just not calling

It doesn’t print anything in output. I have tried creating a new thread with spawn(function() before and it’s not fixing anything.

Try using data like

local Data = {
   content = "hi";
   username = "Name";
}

Uh

local webhook = "https://discordapp.com/api/webhooks/private"

Look at ur URL, it said private, so Roblox might not beable to access it.

He probably did this so he doesn’t reveal his webhook. He probably has the actual key.

1 Like

That didn’t seem to work either.

Try it in-game, It might be some issue with studio

I have been testing it in-game.

Could you make sure there are no spaces before or after the url?

Maybe try to put it in a function like this? I apologize, I have been reading off my Webhook script and we used a function.

local HTTP = game:GetService("HttpService")
local webhook = "https://discordapp.com/api/webhooks/private"
local Players = game:FindService("Players")


function fireWebhook()
   local Data = {
      content = "hi";
      username = "Name";
   }
   HTTP:PostAsync(webhook, HTTP:JSONEncode(Data))
end

Players.PlayerAdded:Connect(fireWebhook)

Also, how did Grammarly detect this as regretful?

I put it in a function and it’s still now working for some reason.

Hello, are you sure the script is being called by your Basic Admin module? Can you print data successfully in this module? Is this located within some function? Is that function being fired?

Yes. I’m calling the function at this line:


And then this is the function:

None of my print statements are working either. Empty output.

Edit: I have also tried spawn() and coroutine.create(). Neither of those made it work.

Interesting, so I don’t think it’s Discord that is the issue. Put a print right before postBan(), and in the other if-statement to start debugging and see where the script is going in runtime.

Edit: hard to read

Nothing is printing from there either.


Welp, start working backwards. Find out why that code is not being called. I’m now almost 100% sure it’s not Discord.

2 Likes

Yeah. The webhook worked perfectly fine from a separate script. I’ll start working backwards.

1 Like