mrmBot-Matrix/commands/general/serverinfo.js

56 lines
1.5 KiB
JavaScript
Raw Normal View History

import Command from "../../classes/command.js";
class ServerInfoCommand extends Command {
async run() {
if (!this.channel.guild) return "This command only works in servers!";
const owner = await this.channel.guild.members.get(this.channel.guild.ownerID);
return {
2021-11-10 04:09:10 +00:00
embeds: [{
title: this.channel.guild.name,
2021-11-10 04:09:10 +00:00
thumbnail: {
url: this.channel.guild.iconURL
},
image: {
url: this.channel.guild.bannerURL
},
2021-11-10 04:09:10 +00:00
color: 16711680,
fields: [
{
2021-11-10 04:09:10 +00:00
name: "🔢 **ID:**",
value: this.channel.guild.id
},
{
2021-11-10 04:09:10 +00:00
name: "👤 **Owner:**",
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.channel.guild.ownerID
},
{
2021-11-10 04:09:10 +00:00
name: "🗓 **Created on:**",
value: `<t:${Math.floor(this.channel.guild.createdAt / 1000)}:F>`
},
{
2021-11-10 04:09:10 +00:00
name: "👥 **Users:**",
value: this.channel.guild.memberCount,
inline: true
},
{
2021-11-10 04:09:10 +00:00
name: "💬 **Channels:**",
value: this.channel.guild.channels.size,
inline: true
},
{
2021-11-10 04:09:10 +00:00
name: "😃 **Emojis:**",
value: this.channel.guild.emojis.length,
inline: true
}
]
2021-11-10 04:09:10 +00:00
}]
};
}
static description = "Gets some info about the server";
static aliases = ["server"];
static directAllowed = false;
}
export default ServerInfoCommand;