Trying to set the header/title of a Discord message via webhook

This should be really easy, but I’ve never done this before so I’m struggling a bit. It posts a new message, but the author of the message is the bot name, and I want to set that title text according to state in-game.

Here’s what I’m using:

local data = {
		["content"] = "Reason: "..string.upper(arrest_reason);
		["author"] = {
			["name"] = jailer.Name.." arrested "..detainee_name;
		}
	}

Thanks :slight_smile:

1 Like

I think you need to use an embed

local data = {
	["content"] = "Reason: "..string.upper(arrest_reason);
	["embeds"] = {
		{
			["author"] = {
				["name"] = jailer.Name.." arrested "..detainee_name;
			}
		}
	}
}

Btw there is a great guide embeds - Discord Webhooks Guide

2 Likes