Haha-Yes/commands/utility/server.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
2018-12-25 19:17:07 +01:00
2018-12-30 01:20:24 +01:00
class ServerCommand extends Command {
constructor() {
super('server', {
aliases: ['server', 'serverinfo'],
category: 'utility',
channelRestriction: 'guild',
description: {
content: 'Show info about the server',
usage: '',
examples: ['']
}
2018-09-16 21:02:11 +02:00
});
}
2018-12-30 01:20:24 +01:00
async exec(message) {
2018-12-18 17:01:28 +01:00
try {
2018-12-30 01:20:24 +01:00
const customresponse = require(`../tag/${message.guild.id}.json`);
2018-12-18 17:01:28 +01:00
var count = Object.keys(customresponse).length
} catch {
var count = 'None'
}
2018-11-28 01:35:26 +01:00
2018-12-30 01:20:24 +01:00
const addEmbed = {
color: 0x0099ff,
title: 'Stats of the server',
thumbnail: {
url: `${message.guild.iconURL}`,
2018-12-30 01:20:24 +01:00
},
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}**`,
2018-12-30 01:20:24 +01:00
};
message.channel.send({ embed: addEmbed });
2018-09-16 21:02:11 +02:00
}
2018-12-30 01:20:24 +01:00
}
module.exports = ServerCommand;