Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const colors = require("../colors.json");
- const config = require("../config.json");
- module.exports.run = async (bot, message, args) => {
- var request = require("request");
- var mcIP = "193.203.39.37";
- var mcPort = "7777";
- var url = 'http://monitor.sacnr.com/api/?IP=' + mcIP + '&Port=' + mcPort + '&Action=info';
- request(url, function(err, response, body) {
- if(err) {
- console.log(err);
- return message.channel.send('Error getting Minecraft server status.');
- }
- body = JSON.parse(body);
- var status = '**JADE.NEPHRITE.RO:** Este in prezent offline.';
- if(body.status) {
- status = '**-> **';
- if(body.stdClass.Players) {
- status += 'JADE.NEPHRITE.RO: **' + body.stdClass.Players + '**/**' + body.stdClass.MaxPlayers + ' jucatori online**';
- } else {
- status += 'JADE.NEPHRITE.RO: **Nu au fost gasiti jucatori pe acest server.**';
- }
- }
- message.channel.send(text);
- });
- }
- module.exports.config = {
- name: "raportu",
- aliases: ["raport", ""],
- usage: "",
- description: "",
- accessableby: "Members"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement