server info!
This commit is contained in:
parent
bc22b79f1d
commit
6149706260
1 changed files with 80 additions and 0 deletions
80
commands/Information/serverinfo.js
Normal file
80
commands/Information/serverinfo.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
const dateFormat = require('dateformat');
|
||||
|
||||
const now = new Date();
|
||||
dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT');
|
||||
|
||||
exports.run = async (client, message, args, level) => {
|
||||
const millis = new Date().getTime() - message.guild.createdAt.getTime();
|
||||
const days = millis / 1000 / 60 / 60 / 24;
|
||||
|
||||
const owner = message.guild.owner.user || {};
|
||||
|
||||
const verificationLevels = ['None', 'Low', 'Medium', 'Insane', 'Extreme'];
|
||||
|
||||
let embed = client.embed(
|
||||
`${message.guild.name}`,
|
||||
'***This message will dissappear in 60 seconds.***',
|
||||
[
|
||||
{
|
||||
name: 'Created On',
|
||||
value: `${dateFormat(message.guild.createdAt)}`,
|
||||
},
|
||||
{
|
||||
name: 'Days Since Creation',
|
||||
value: `${days.toFixed(0)}`,
|
||||
},
|
||||
{
|
||||
name: 'Region',
|
||||
value: `${message.guild.region}`,
|
||||
},
|
||||
{
|
||||
name: 'Member Count',
|
||||
value: `**${message.guild.members.filter(m => m.presence.status !== 'offline' && !m.bot).size}** online / **${message.guild.members.filter(m => !m.bot).size}** total`,
|
||||
},
|
||||
{
|
||||
name: 'Owner',
|
||||
value: `${owner.username || 'None'}`,
|
||||
},
|
||||
{
|
||||
name: 'Text Channels',
|
||||
value: `${message.guild.channels.filter(m => m.type === 'text').size}`,
|
||||
},
|
||||
{
|
||||
name: 'Voice Channels',
|
||||
value: `${message.guild.channels.filter(m => m.type === 'voice').size}`,
|
||||
},
|
||||
{
|
||||
name: 'Verification Level',
|
||||
value: `${verificationLevels[message.guild.verificationLevel]}`,
|
||||
},
|
||||
{
|
||||
name: 'Roles',
|
||||
value: `${message.guild.roles.size}`,
|
||||
},
|
||||
],
|
||||
{
|
||||
inline: true,
|
||||
footer: `Guild ID: ${message.guild.id}`
|
||||
}
|
||||
);
|
||||
|
||||
if (message.guild.iconURL != null) {
|
||||
embed.setThumbnail(`${message.guild.iconURL}`);
|
||||
}
|
||||
|
||||
(await message.channel.send({ embed })).delete(60000);
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: ["server","guildinfo","guild"],
|
||||
permLevel: "User"
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: "serverinfo",
|
||||
category: "Information",
|
||||
description: "Returns the current guild's information.",
|
||||
usage: "serverinfo"
|
||||
};
|
Loading…
Reference in a new issue