if (Config.ImageUploadingType == 'DiscordWebhooks') { // Updated by Serhatsal
const _0x382eeb = new FormData()
_0x382eeb.append('file', dataURItoBlob(_0x171bd3), 'screenshot.jpg')
let _0x587f6a = {
content: Config.ImageUploading[Config.ImageUploadingType].Content.formatText(ESX.Phone.playerName, ESX.Phone.playerId),
}
_0x382eeb.append('payload_json', JSON.stringify(_0x587f6a))
const _0x339ca1 = {
method: 'POST',
body: _0x382eeb,
}
fetch(Config.ImageUploading[Config.ImageUploadingType].Url, _0x339ca1)
.then((_0x50e9a3) => _0x50e9a3.text())
.then((_0x17165b) => {
const response = JSON.parse(_0x17165b);
const attachmentId = response.attachments[0].id;
const channelId = response.channel_id;
const fileExtension = '.jpg';
// Proccess discord proxy attachaments
const ex = response.attachments[0].proxy_url.split("?")[1].split("&")[0].split("=")[1];
const is = response.attachments[0].proxy_url.split("?")[1].split("&")[1].split("=")[1];
const hm = response.attachments[0].proxy_url.split("?")[1].split("&")[2].split("=")[1];
const cdnUrl = `https://cdn.discordapp.com/attachments/${channelId}/${attachmentId}/screenshot${fileExtension}?ex=${ex}&is=${is}&hm=${hm}`;
if (ESX.Phone.gallery[_0x3a58bb]) {
ESX.Phone.gallery[_0x3a58bb].url = cdnUrl;
ESX.Phone.gallery[_0x3a58bb].src = cdnUrl;
}
_0x599741(cdnUrl);
})
.catch((_0x396405) => _0x599741(false));
}