Why does my webhook not work?

YES I AM USING A PROXY AND HAVE HTTP SERVICE TURNED ON
Sorry for screaming at you, but most users on the Devforum do not read the entire post. Alright, now on to explain my problem. I am currently using Discord Webhooks for Ban Logs, but the webhook does not fire for some odd reason.

_G.GlobalIdBanPlayer = function(UserId, reason, moderator)
	local Data 
	local Player_ID = "Player_" .. UserId

	local Success, err = pcall(function()
		Data = DataStore:GetAsync(Player_ID)
	end)

	if not Data.BanWave then		
		Data.BanWave = true
		Data.Banned = true
		
		local success,err = pcall(DataStore.UpdateAsync, DataStore, "Player_"..UserId, function()
			return Data
		end) 
		
		print(Data) -- Prints Data
		
		local PlrName = game.Players:GetNameFromUserIdAsync(UserId)
		
		local success, err = pcall(function()
			WebhookModule.SendBanMessage(PlrName, reason, moderator)	
		end)
		
		if err then
			print(err) -- Nothing is printed here
		end
		
		print(PlrName, reason, moderator) -- Never prints anything
	end
end
local module = {}

local http = game:GetService("HttpService")

function module.SendBanMessage(PlayerName, Reason, Moderator)	
	print(PlayerName, Reason, Moderator) - Prints DaMePlayzGames, Hacking, AntiExploits

	local HookData = {
		["embeds"] = {{
			['username'] = PlayerName,
			["title"] = PlayerName.." Has Been Banned.",
			["description"] = PlayerName.." has been Banned because: "..Reason,
			["type"] = "rich",
			["color"] = tonumber(0x4287f5),
			["fields"] = {
				{
					["name"] = "__Moderator__",
					["value"] = Moderator,
					["inline"] = true
				}
			}
		}}
	}

	HookData = http:JSONEncode(HookData)
	http:PostAsync("https://hooks.hyra.io/api/webhooks/", HookData)
	print(PlayerName, Reason, Moderator) -- Does not fire
end

return module
1 Like

are you actually adding the Discord webhook, the posyasync url isnt a full webhook, or at least doesnt notion to one

1 Like

Yes, I am. Only added that for security purposes.

1 Like

Update: It seems that only does not work for my game for some reason. I tried it in a separate game with the exact same code and it worked.

1 Like

Nevermind, is not just my game. Is 100% the way I am firing the function.

1 Like