Advertisement
Guest User

Untitled

a guest
May 2nd, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const colors = require("../colors.json");
  3. const config = require("../config.json");
  4.  
  5. module.exports.run = async (bot, message, args) => {
  6.  
  7.     var request = require("request");
  8.     var mcIP = "193.203.39.37";
  9.     var mcPort = "7777";
  10.     var url = 'http://monitor.sacnr.com/api/?IP=' + mcIP + '&Port=' + mcPort + '&Action=info';
  11.  
  12.     request(url, function(err, response, body) {
  13.  
  14.         if(err) {
  15.  
  16.             console.log(err);
  17.             return message.channel.send('Error getting Minecraft server status.');
  18.  
  19.         }
  20.  
  21.         body = JSON.parse(body);
  22.  
  23.         var status = '**JADE.NEPHRITE.RO:** Este in prezent offline.';
  24.  
  25.         if(body.status) {
  26.  
  27.             status = '**-> **';
  28.  
  29.             if(body.stdClass.Players) {
  30.  
  31.                 status += 'JADE.NEPHRITE.RO: **' + body.stdClass.Players + '**/**' + body.stdClass.MaxPlayers + ' jucatori online**';
  32.  
  33.             } else {
  34.  
  35.                 status += 'JADE.NEPHRITE.RO: **Nu au fost gasiti jucatori pe acest server.**';
  36.  
  37.             }
  38.  
  39.         }
  40.  
  41.         message.channel.send(text);
  42.  
  43.  
  44.     });
  45.  
  46.  
  47. }
  48.  
  49. module.exports.config = {
  50.  
  51.     name: "raportu",
  52.     aliases: ["raport", ""],
  53.     usage: "",
  54.     description: "",
  55.     accessableby: "Members"
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement