How can I make the message I send with a webhook drop a line?

How can I make the message I send to Discord drop a line?

What I currently have (sends three seperate messages to create a line drop):

game.ReplicatedStorage.Logging.OnServerEvent:Connect(function(Plr, Value, Time)
	if Value == "SendToDiscord" and Time >= 1 and Plr:GetRankInGroup() >= 1 then
		local http = game:GetService("HttpService")
		local Top = "Username: "..Plr.Name
		local Bottom = "Time logged: "..Time.." minutes"
		local Data = {
			["content"] = Top
		}
		Data = http:JSONEncode(Data)
		http:PostAsync("", Data)
		local Data = {
			["content"] = Bottom
		}
		Data = http:JSONEncode(Data)
		http:PostAsync("", Data)
		local Data = {
			["content"] = "--------------------------"
		}
		Data = http:JSONEncode(Data)
		http:PostAsync("", Data)
	end
end)

Keep in mind that I removed the group ID and discord webhook address for security purposes.

I’m a bit ignorant of how webhooks work (since i’ve never used them), but would consolidating all the lines into a single message be more efficient in terms of requiring fewer http requests?

local Data = {
	["content"] = Top.."\n"..Bottom.."\n--------------------------"
}

Just put \n inside the “” before the text you want to be on another line.

Example:

"This is on line 1\n this is on line 2"
1 Like