Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find the property of name of undefined? #59

Open
swayam-crypto opened this issue Mar 27, 2021 · 2 comments
Open

cannot find the property of name of undefined? #59

swayam-crypto opened this issue Mar 27, 2021 · 2 comments

Comments

@swayam-crypto
Copy link

No description provided.

@swayam-crypto
Copy link
Author

var commando = require('discord.js-commando');
var Discord = require('discord.js');

class serverInfo extends commando.Command
{
constructor(client) {
super(client, {
name: 'server-info',
group: 'guild',
memberName: 'server-info',
description: 'Lists information about The Server.',
aliases: ['si', 'serveri', 'sinfo', 'server'],
})
}
async run(client, message, args) {
function checkDays(date) {
let now = new Date();
let diff = now.getTime() - date.getTime();
let days = Math.floor(diff / 86400000);
return days + (days == 1 ? " day" : " days") + " ago";
};
let verifLevels = ["None", "Low", "Medium", "(╯°□°)╯︵ ┻━┻", "┻━┻ミヽ(ಠ益ಠ)ノ彡┻━┻"];
let region = {
"brazil": ":flag_br: Brazil",
"eu-central": ":flag_eu: Central Europe",
"singapore": ":flag_sg: Singapore",
"us-central": ":flag_us: U.S. Central",
"sydney": ":flag_au: Sydney",
"us-east": ":flag_us: U.S. East",
"us-south": ":flag_us: U.S. South",
"us-west": ":flag_us: U.S. West",
"eu-west": ":flag_eu: Western Europe",
"vip-us-east": ":flag_us: VIP U.S. East",
"london": ":flag_gb: London",
"amsterdam": ":flag_nl: Amsterdam",
"hongkong": ":flag_hk: Hong Kong",
"russia": ":flag_ru: Russia",
"southafrica": ":flag_za: South Africa"
};
console.log(message)
const embed = new Discord.MessageEmbed()
.setAuthor(message.guild.name , message.guild.iconURL)
.addField("Name", message.guild.name , true)
.addField("ID", message.guild.id , true)
.addField("Owner", ${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}, true)
.addField("Region", region[message.guild.region], true)
.addField("Total | Humans | Bots", ${message.guild.members.cache.size} | ${message.guild.members.cache.filter(member => !member.user.bot).size} | ${message.guild.members.cache.filter(member => member.user.bot).size}, true)
.addField("Verification Level", message.guild.verificationLevel, true)
.addField("Channels", message.guild.channels.cache.size, true)
.addField("Roles", message.guild.roles.cache.size, true)
.addField("Creation Date", ${message.channel.guild.createdAt.toUTCString().substr(0, 16)} (${checkDays(message.channel.guild.createdAt)}), true)
.setThumbnail(message.guild.iconURL())
message.channel.send({embed});
}
}

module.exports = serverInfo;

@ntnwlrs57
Copy link

How I can fix this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants