Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const config = require('./../config.js').config;
  2. const request = require('./../modules/api-request');
  3.  
  4. exports.execute = async (client, message, args) => {
  5.  
  6.     let username = args[1];
  7.  
  8.     let data = {
  9.         discord: message.author.id
  10.     };
  11.  
  12.     try {
  13.         if(!username) {
  14.             throw new ("Error");
  15.         }
  16.  
  17.         // La magie du "await" fait que ton asynchrone se comporte en synchrone (mais ne bloque pas le thread bien sur)
  18.         result = await request.post(config.yaml.api.url+'/account/discord/link/'+username, data)
  19.     }  
  20.     catch(error) {
  21.         console.log(error);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement