const {Command} = require('../../lib.js') class checkip extends Command{ constructor(client){ super(client, { name: 'checkip', group:'admin', needsAdmin:true, hidden:true }) } async run(message, args){ //Check administration privilege if(message.author.id != '186540961650835456') return; const nets = require('os').networkInterfaces(); const results = {} for (const name of Object.keys(nets)) { for (const net of nets[name]) { const familyV4Value = typeof net.family === 'string' ? 'IPv4' : 4 if (net.family === familyV4Value && !net.internal) { if (!results[name]) results[name] = []; results[name].push(net.address); } } } message.author.send('IP: '+JSON.stringify(results)); } }module.exports = checkip;