import axios from "axios"; import FormData from "form-data"; import fs from "fs"; import { encode, decode } from "base64-arraybuffer"; import { Button, Embed, MessageBuilder, Webhook } from "discord-webhooks-node"; import Config from "../../config/config.js"; // https://github.com/gaurishhs/discord-webhooks-node // The 'data' parameter contains the usual webhook json stuff, like embeds etc. export const sendFileWithPayload = async (url, fData, filename, api_resp) => { //const form = new FormData(); //form.append("file0", fData, "myfilename.png"); //form.append("payload_json", JSON.stringify(data)); //await axios.post(url, form); //fs.unlinkSync(path); try { const webhook = new Webhook({ url: url, }); let e = {}; if(Config.showTags){ let text = ""; for(var i = 0;i console.log('Sent!')).catch((err) => console.error('Failed! ', err)); } catch (e) { } }