SHARE
TWEET

Untitled

a guest Mar 25th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.post("/setrole", (req, res) => {
  2.   let discorduserid = req.query.discorduserid;
  3.   let getrankint = req.query.rank;
  4.   const server = Client.guilds.get(serverid)
  5.   const member = server.fetchMember(discorduserid);
  6.   console.log(member);
  7.   if(!getrankint > 5 && discorduserid != null){
  8.     switch(getrankint) {
  9.       case 0:{
  10.         //give cadet rank
  11.       }
  12.       case 1: {
  13.         //give second officer rank
  14.       }
  15.       case 2:{
  16.         //give first officer rank
  17.       }
  18.       case 3:{
  19.         //give senior first officer rank
  20.       }
  21.       case 4:{
  22.         //give training captian rank
  23.       }
  24.       case 5:{
  25.         //give captain rank
  26.       }
  27.     }
  28.   }
  29.   else
  30.   {
  31.     res.jsonp({
  32.       error: "Their was an error processing your request please check to see if the Discord user ID is was null and or you forgot to send the pilot int number for the role."
  33.     });
  34.     return;
  35.   }
  36. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top