SHARE
TWEET

Untitled

a guest Apr 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { RichEmbed } = require('discord.js');
  2. const fetch = require('node-fetch');
  3. const superagent = require('superagent');
  4.  
  5. exports.run = async (client, message, args) => {
  6.     const guildName = message.content.slice(13);
  7.     var rp = require('request-promise');
  8.     rp({
  9.         uri: 'https://api.tibiadata.com/v2/guild/' + guildName + '.json',
  10.         json: true
  11.     })
  12.     .then(function(res) {
  13.         if (!res) return;
  14.  
  15.         for (i = 0; i < res.guild.members.characters[i]; i++) {
  16.             //if (res.guild.members.characters[i].status == "online") {
  17.             console.log(res.guild.members.characters[i].name);
  18.             //}
  19.         }
  20.  
  21.         let embed = new RichEmbed()
  22.             .setColor(0xdd9323)
  23.             .setDescription(`
  24.        
  25.             **${res.guild.data.name}**
  26.             ${res.guild.data.world}
  27.             ${res.guild.data.online_status} / ${res.guild.data.totalmembers} members online
  28.        
  29.             `);
  30.  
  31.     message.channel.send(embed);
  32.     //console.log(res);
  33. })
  34. .catch(function(err) {
  35.     console.error(err)
  36. });
  37. }
  38.  
  39. exports.help = {
  40.     name: "onlinelist"
  41. }
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
 
Top