2020-06-19 23:02:16 +02:00
|
|
|
const { Command } = require('../../../../interfaces');
|
2020-05-24 23:40:38 +02:00
|
|
|
|
|
|
|
class GuildCommand extends Command {
|
|
|
|
|
|
|
|
constructor(client) {
|
|
|
|
|
|
|
|
super(client, {
|
2020-06-02 12:09:28 +02:00
|
|
|
name: 'guild',
|
2020-06-19 23:02:16 +02:00
|
|
|
module: 'information',
|
2020-05-24 23:40:38 +02:00
|
|
|
aliases: [
|
2020-06-02 12:09:28 +02:00
|
|
|
'server'
|
2020-05-24 23:40:38 +02:00
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
this.client = client;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
async execute(message) {
|
|
|
|
|
2020-08-06 00:13:09 +02:00
|
|
|
const guild = await message.guild.fetch();
|
2020-05-24 23:40:38 +02:00
|
|
|
|
|
|
|
let vc = 0,
|
2020-08-06 00:13:09 +02:00
|
|
|
tc = 0,
|
|
|
|
totalChannels = 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)`;
|
2020-08-06 00:13:09 +02:00
|
|
|
const description = guild._settings.description || message.format('C_GUILD_NODESC');
|
|
|
|
const maxMembers = guild.maximumMembers;
|
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++;
|
2020-08-06 00:13:09 +02:00
|
|
|
totalChannels++;
|
2020-05-24 23:40:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return message.embed({
|
|
|
|
description: message.format('C_GUILD_TEMPLATE', {
|
|
|
|
createdAt,
|
|
|
|
description,
|
2020-08-06 00:13:09 +02:00
|
|
|
maxMembers,
|
|
|
|
totalChannels,
|
2020-05-24 23:40:38 +02:00
|
|
|
vc,
|
|
|
|
tc,
|
|
|
|
owner: guild.owner.id,
|
|
|
|
id: guild.id,
|
|
|
|
name: guild.name,
|
|
|
|
region: guild.region,
|
2020-06-19 23:02:16 +02:00
|
|
|
members: guild.memberCount,
|
|
|
|
boosters: guild.premiumSubscriptionCount,
|
|
|
|
tier: guild.premiumTier,
|
|
|
|
shard: guild.shardID
|
2020-05-24 23:40:38 +02:00
|
|
|
}),
|
|
|
|
thumbnail: {
|
|
|
|
url: guild.iconURL()
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = GuildCommand;
|