discord_bot/commands/serverinfo.js
SileNce5k c51a4fa976
Pass objects on command.execute
Pass objects instead of using a switch statement.
Now I don't have to restart the bot whenever I add a new command
that needs specific arguments other than 'message'.
2021-03-09 18:50:27 +01:00

23 lines
No EOL
817 B
JavaScript

const Discord = require('discord.js')
module.exports = {
name: 'serverinfo',
description: 'Displays information about the server',
execute({message}) {
console.log(message.guild.emojis.cache)
const embed = new Discord.MessageEmbed()
.setThumbnail(message.guild.iconURL({ format: 'png', dynamic: true, size: 4096 }))
.setColor("#ee7939")
.setTimestamp()
.addField("Server Owner: ", `<@${message.guild.ownerID}>`)
.addField("Server Name: ", message.guild.name)
.addField("Created", message.guild.createdAt.toUTCString())
.addField("Members: ", message.guild.memberCount)
//.addField("Emojis: ", message.guild.emojis.cache.array().length)
message.channel.send(embed);
}
};