Advertisement
notjacob

getclan

Mar 22nd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function clan(name) {
  2.     try {
  3.         cc = null;
  4.         console.log(`https://bungie.net/Platform/GroupV2/Name/${name}/1`);
  5.         await got(`https://bungie.net/Platform/GroupV2/Name/${name}/1`, {headers:h}).then( a => {
  6.             parsed = JSON.parse(a.body);
  7.             detail = parsed.Response.detail;
  8.             cc = new BungieClan(detail.groupId, parsed);
  9.         });
  10.         return cc;
  11.     } catch (error) {
  12.         console.error(error);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement