Zaayd

top-xp-probot

Sep 17th, 2021
807
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Code By : Me , 9 9 9 <Revolun/>#7777 & - Đeep,,#7160
  2. const { MessageEmbed , WebhookClient } = require("discord.js");
  3. const request = require("request");
  4. const axios = require("axios");
  5. module.exports = {
  6.     config: {
  7.         name: "top-xp-probot",
  8.         aliases: ["txp"],
  9.         description: "",
  10.         category: "general",
  11.         usage: "top-xp-probot",
  12.     },
  13.   run: async (bot, message) => {
  14.     const response = await axios.get('https://api.probot.io/top_xp');
  15.     let i = 0;
  16.     let x = 1;
  17.     let finalLb = "";
  18.     while (i<10){
  19.         finalLb += `**#${x} - Name : ${response.data[i].name} | Tag : ${response.data[i].discriminator} | XP : ${String(response.data[i].xp)} | Level : ${String(response.data[i].level)}**\n`;
  20.         x++;
  21.         i++;
  22.     }
  23.     let TopXp = new MessageEmbed()
  24.         .setTitle(`Top 10 by XP`)
  25.         .setColor(`BLACK`)
  26.         .setThumbnail(response.data[0].avatar)
  27.         .addField(`**TOP 10 - **`,finalLb)
  28.         .setFooter(`Request by ${message.author.tag}`,message.author.avatarURL({dynamic:true}))
  29.         .setTimestamp()
  30.     message.channel.send(TopXp)
  31.   },
  32. };
  33. //Code By : Me , 9 9 9 <Revolun/>#7777 & - Đeep,,#7160
RAW Paste Data