Hello there,
I can’t figure out how to correctly send a string as .txt file through a discord webhook. I always receive error 400 bad request. Does anyone know how to properly do this?
Some context: Discord Developer Portal
function Util.SendFileToWebHook(url, data, filename)
PerformHttpRequest(url, function(err, text, headers) print(err) end, "POST", string.format(data), {
["Content-Disposition"] = 'form-data; name="file"; filename="' .. filename .. '"',
["Content-Type"] = "multipart/form-data"
})
end
end