Wont post to discord channel via webhook post

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Post to webhook
  2. What is the issue? Include screenshots / videos if possible!
    Wont post to discord channel via webhook post
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

No solutions, and there was no scripting error/warnings popping up.

Script:

function LogToDiscord(user, state)
local success = pcall(function()
local data = {
			  content = user.Name .. " has "..state.." the alarm!";
			  username = user.Name;
			  avatar_url = game.Players:GetUserThumbnailAsync(user.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100);
			}
		HttpService:PostAsync("https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxx/dckVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", HttpService:JSONEncode(data))
end)
end




AlarmsFolder.Remotes.RemoteFunction.OnServerInvoke = function(user,command)
	if user then
		local Check = GetPermission(user)
		if Check then
			if command and not cooldown then
				cooldown = true
				CooldownBool.Value = true
				BeginAlarms()
				LogToDiscord(user, "turned")
				wait(cooldowntime)
				CooldownBool.Value = false
				cooldown = false
			elseif not cooldown and not command then
				cooldown = true
				CooldownBool.Value = true
				StopAlarms()
				LogToDiscord(user, "disabled")
				wait(cooldowntime)
				CooldownBool.Value = false
				cooldown = false
			end
		end
	end
end

It looks like your JSON body is invalid.

try using a website such as Discohook to build an embed instead of making one from scratch

I don’t think that’s the main issue, it doesn’t pop up in the output on roblox studio as an error or warning upon triggering.