2020-05-24 23:40:38 +02:00
|
|
|
const { Command } = require('../../../../interfaces/');
|
|
|
|
|
|
|
|
class GuildCommand extends Command {
|
|
|
|
|
|
|
|
constructor(client) {
|
|
|
|
|
|
|
|
super(client, {
|
2020-06-02 12:09:28 +02:00
|
|
|
name: 'guild',
|
2020-05-24 23:40:38 +02:00
|
|
|
module: 'utility',
|
|
|
|
aliases: [
|
2020-06-02 12:09:28 +02:00
|
|
|
'server'
|
2020-05-24 23:40:38 +02:00
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
this.client = client;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
async execute(message) {
|
|
|
|
|
|
|
|
const { guild } = message;
|
|
|
|
|
|
|
|
let vc = 0,
|
|
|
|
tc = 0;
|
2020-06-02 12:09:28 +02:00
|
|
|
const createdAt = `${guild.createdAt.toDateString()} (${this.client.resolver.timeAgo(Math.floor(Date.now() / 1000) - Math.floor(guild.createdTimestamp / 1000))} ago)`;
|
|
|
|
const description = guild._settings.description || 'N/A';
|
2020-05-24 23:40:38 +02:00
|
|
|
|
|
|
|
for (const channel of guild.channels.cache.values()) {
|
|
|
|
if (channel.type === 'voice') vc++;
|
|
|
|
if (channel.type === 'text') tc++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return message.embed({
|
|
|
|
description: message.format('C_GUILD_TEMPLATE', {
|
|
|
|
createdAt,
|
|
|
|
description,
|
|
|
|
vc,
|
|
|
|
tc,
|
|
|
|
owner: guild.owner.id,
|
|
|
|
id: guild.id,
|
|
|
|
name: guild.name,
|
|
|
|
region: guild.region,
|
|
|
|
members: guild.memberCount
|
|
|
|
}),
|
|
|
|
thumbnail: {
|
|
|
|
url: guild.iconURL()
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = GuildCommand;
|