Sending in a webhook to discord with no errors and debug messages in sight

  1. What do you want to achieve?
    I’d like the send to a webhook for everytime a player is kicked, banned or unbanned.

  2. What is the issue?
    The script is not sending the webhooks, no debug messages either. None of that

warn("Failed to send message to Discord webhook. Response:", response)


print("Message sent to Discord webhook successfully.")
  1. What solutions have you tried so far?
    Everything I know. The ban, kick, and unban works while the sendWebhook function doesn’t to work.
local authorizedPlayers = {}
local HttpService = game:GetService("HttpService")
local webhookURL = ""

local function sendWebhook(title, description, url, admin, timestamp)
	local success, response = pcall(function()
		return HttpService:PostAsync(webhookURL, HttpService:JSONEncode({
			embeds = {{
				title = title,
				description = description,
				url = url,
				fields = {{
					name = "Admin",
					value = admin.Name,
					inline = false
				}, {
					name = "Timestamp",
					value = timestamp,
					inline = false
		}), Enum.HttpContentType.ApplicationJson)

	if not success then
		warn("Failed to send message to Discord webhook. Response:", response)
		print("Message sent to Discord webhook successfully.")

local function banPlayer(admin, player, reason, sendMessage)
	if sendMessage then
		local banDate ="%c")
		sendWebhook(player.Name .. " has been banned", "Reason: " .. reason, "" .. player.UserId .. "/profile", admin, banDate)

local function unbanPlayer(admin, playerId)
	sendWebhook("Player with ID " .. playerId .. " has been unbanned", "", "" .. playerId .. "/profile", admin,"%c"))

local function kickPlayer(admin, player, reason)
	sendWebhook(player.Name .. " has been kicked", "Reason: " .. reason, "" .. player.UserId .. "/profile", admin,"%c"))

I’ve hidden the rest of the code

I believe you came across an issue that I was dealing with long time ago.
You will have to use proxy for sending discord webhooks & I recommend using this :smiley:

Yes, Discord blocked Roblox from using their Webhooks due to spam. Use a proxy as @CodeSaviour suggested.