Haha-Yes/commands/utility/server.js

42 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2018-09-16 21:02:11 +02:00
const { Command } = require('discord.js-commando');
2018-11-28 01:35:26 +01:00
const SelfReloadJSON = require('self-reload-json');
2018-12-25 19:17:07 +01:00
const blacklist = require('../../json/blacklist.json');
2018-12-05 00:52:21 +01:00
2018-09-16 21:02:11 +02:00
module.exports = class ServerCommand extends Command {
constructor(client) {
super(client, {
name: 'server',
group: 'utility',
guildOnly: 'true',
2018-09-16 21:02:11 +02:00
memberName: 'server',
description: 'Show some stats about the server',
2018-09-21 14:03:07 +02:00
guildOnly: true,
2018-09-16 21:02:11 +02:00
});
}
async run(message) {
2018-12-06 19:42:12 +01:00
let blacklistJson = new SelfReloadJSON('./json/blacklist.json');
2018-11-28 01:35:26 +01:00
if(blacklistJson[message.author.id])
return blacklist(blacklistJson[message.author.id] , message)
2018-12-06 19:42:12 +01:00
2018-12-18 17:01:28 +01:00
try {
let customresponse = new SelfReloadJSON(`./tag/${message.guild.id}.json`);
var count = Object.keys(customresponse).length
} catch {
var count = 'None'
}
2018-11-28 01:35:26 +01:00
const addEmbed = {
color: 0x0099ff,
title: 'Stats of the server',
thumbnail: {
url: `${message.guild.iconURL}`,
},
2018-12-06 19:42:12 +01:00
description: `Member: **${message.guild.memberCount}** \nChannel number: **${message.guild.channels.size}**\nGuild created at **${message.guild.createdAt}**\nOwner: **${message.guild.owner}**\nTag number: **${count}**`,
};
message.say({ embed: addEmbed });
2018-09-16 21:02:11 +02:00
}
};