mrmBot-Matrix/commands/general/serverinfo.js

52 lines
1.5 KiB
JavaScript
Raw Normal View History

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