Can I send a .txt file from game to a discord server?

Hello, I am creating a game with a hard-to-deal mechanics. It is a library and I am looking to create a cross-server data source. Normal datastore cannot help me with that, nor MessaginService, so I think using http request with discord should be a great idea.

I know how to send a normal message to a discord server, but it has a limit of 2000 characteres. My messages can be greater than this, so I wanna try to send in .txt file format, just like Discord does with a msg sent from client greater than that.

This is the code I used to test normal msg:

local webhookURL = "~~my webhook url~~"
local httpService = game:GetService("HttpService")

local data = {
    ['embeds'] = {{

		['title'] = "Look a title here hehe",
	    ['description'] = "xxxx",
	    ['color'] = 16752127

     }}
}

local finalData = httpService:JSONEncode(data)
httpService:PostAsync(webhookURL, finalData)

Any tip in how could I accomplish that?

You could make more than one embed.
For example:

local webhookURL = "~~my webhook url~~"
local httpService = game:GetService("HttpService")

local myEmbed1 = {

		['title'] = "Look a title here hehe",
	    ['description'] = "xxxx",
	    ['color'] = 16752127

     }

local myEmbed2 = {

		['title'] = "Hello world!",
	    ['description'] = "xxxx",
	    ['color'] = 16752127

     }

local data = {
    ['embeds'] = {myEmbed1, myEmbed2}
}

local finalData = httpService:JSONEncode(data)
httpService:PostAsync(webhookURL, finalData)

Also, Keep in mind that sending multiple posts to a webhook can get it potentially deleted! :wink: