Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function pastebinDump(data, name, expiration = '1D') {
- try {
- let paste = `api_dev_key=${Credentials.pastebin}&api_option=paste&api_paste_code=${data}&api_paste_name=${name}&api_paste_expire_date=${expiration}`;
- let postRequest = await axios.post(`https://pastebin.com/api/api_raw.php`, paste, {
- headers: {
- "Content-type": "application/x-www-form-urlencoded"
- }
- }).then(res => res.data);
- return typeof postRequest === 'string' && `https://pastebin.com/raw/${postRequest.split('/').slice(-1)}`;
- } catch (error) {
- console.log(error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement