Advertisement
Profesar

Untitled

Dec 1st, 2021
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. async function pastebinDump(data, name, expiration = '1D') {
  2. try {
  3. let paste = `api_dev_key=${Credentials.pastebin}&api_option=paste&api_paste_code=${data}&api_paste_name=${name}&api_paste_expire_date=${expiration}`;
  4. let postRequest = await axios.post(`https://pastebin.com/api/api_raw.php`, paste, {
  5. headers: {
  6. "Content-type": "application/x-www-form-urlencoded"
  7. }
  8. }).then(res => res.data);
  9. return typeof postRequest === 'string' && `https://pastebin.com/raw/${postRequest.split('/').slice(-1)}`;
  10. } catch (error) {
  11. console.log(error);
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement