Unable to cast value to std::string

So I’m trying to send logs of command usage to a discord channel but it gives me an error that I don’t know anything about.

local data = {
	["content"] = Player.Name.. " banned ".. CurrentPlayer,
	["username"] = "Logs: Player ban alert"
}
		
local encode = http:JSONDecode(data)
http:PostAsync("secret api code", encode)

The error is on the line

local encode = http:JSONDecode(data)

Did you mean to write JSONEncode instead of JSONDecode?

1 Like

Yes! Thank you. It worked. :smiley:

1 Like

Anytime! If you have anymore issues don’t be afraid to make another post!