2018-12-30 01:20:24 +01:00
|
|
|
|
const { Command } = require('discord-akairo');
|
2020-06-03 00:45:13 +02:00
|
|
|
|
const LogStats = require('../../models/').LogStats;
|
2018-12-25 19:17:07 +01:00
|
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
|
class ServerCommand extends Command {
|
2019-01-02 08:09:45 +01:00
|
|
|
|
constructor() {
|
|
|
|
|
super('server', {
|
|
|
|
|
aliases: ['server', 'serverinfo'],
|
|
|
|
|
category: 'utility',
|
2019-11-09 12:04:01 +01:00
|
|
|
|
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
|
2020-03-19 23:24:31 +01:00
|
|
|
|
channel: 'guild',
|
2019-01-02 08:09:45 +01:00
|
|
|
|
description: {
|
2018-12-30 01:20:24 +01:00
|
|
|
|
content: 'Show info about the server',
|
|
|
|
|
usage: '',
|
|
|
|
|
examples: ['']
|
|
|
|
|
}
|
2019-01-02 08:09:45 +01:00
|
|
|
|
});
|
|
|
|
|
}
|
2018-09-16 21:02:11 +02:00
|
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
|
async exec(message) {
|
2020-03-04 12:41:46 +01:00
|
|
|
|
let botCount = message.guild.members.cache.filter(member => member.user.bot).size;
|
2019-11-22 12:30:20 +01:00
|
|
|
|
const addEmbed = this.client.util.embed()
|
2020-03-22 21:54:19 +01:00
|
|
|
|
.setColor(message.member ? message.member.displayHexColor : 'NAVY')
|
2019-05-16 16:33:52 +02:00
|
|
|
|
.setTitle(message.guild.name)
|
2019-03-31 00:37:07 +01:00
|
|
|
|
.setThumbnail(message.guild.iconURL())
|
2019-12-07 19:32:27 +01:00
|
|
|
|
.addField('Number of users', message.guild.memberCount - botCount, true)
|
|
|
|
|
.addField('Number of bots', botCount, true)
|
2019-09-30 16:51:00 +02:00
|
|
|
|
.addField('Total number of members', message.guild.memberCount, true)
|
2020-06-03 00:45:13 +02:00
|
|
|
|
.addField('Number of channels', message.guild.channels.cache.size, true)
|
2020-03-04 12:29:32 +01:00
|
|
|
|
.addField('', '')
|
2019-01-23 21:34:01 +01:00
|
|
|
|
.addField('Date when guild created', message.guild.createdAt, true)
|
|
|
|
|
.addField('Owner', message.guild.owner, true)
|
2019-01-02 10:21:21 +01:00
|
|
|
|
.setTimestamp();
|
|
|
|
|
|
2020-06-03 00:45:13 +02:00
|
|
|
|
const logStats = await LogStats.findOne({where: {guild: message.guild.id}});
|
|
|
|
|
|
|
|
|
|
if (logStats) addEmbed.addField('Logging', 'On ✅');
|
|
|
|
|
else addEmbed.addField('Logging', 'Off ❌');
|
|
|
|
|
|
2021-07-23 04:19:47 +02:00
|
|
|
|
message.reply({ embed: addEmbed });
|
2019-01-02 08:09:45 +01:00
|
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2020-06-03 00:45:13 +02:00
|
|
|
|
module.exports = ServerCommand;
|