-
Notifications
You must be signed in to change notification settings - Fork 255
Better serverinfo command #11
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
base: master
Are you sure you want to change the base?
Conversation
Remember that "IconURL" shouldnt be used as a function, this gives back an error. You need to change these two code lines: .setAuthor(message.guild.name, message.guild.iconURL()) Change it into this or it simply wont work since iconURL isnt a valid function. .setAuthor(message.guild.name, message.guild.iconURL) |
Sorry, this code was originally made for Discord.js version 12.0.0-dev, in this version it needs to be iconURL() and avatarURL() |
I've fixed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Job of improving
const Discord = require("discord.js"); | ||
|
||
module.exports.run = async (bot, 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 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cood
"russia": ":flag_ru: Russia", | ||
"southafrica": ":flag_za: South Africa" | ||
}; | ||
const embed = new Discord.RichEmbed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const embed = new Discord.MessageEmbed() // Discord V12
.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.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, 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) | |
For Discord.js V12
.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.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true) | ||
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true) | |
.addField("Verification Level", message.guild.verificationLevel, true) | |
For Discord.js V12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
گوزززز
.addField("Region", region[message.guild.region], true) | ||
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true) | ||
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true) | ||
.addField("Channels", message.guild.channels.size, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.addField("Channels", message.guild.channels.size, true) | |
.addField("Channels", message.guild.channels.cache.size, true) | |
For Discord.js V12
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true) | ||
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true) | ||
.addField("Channels", message.guild.channels.size, true) | ||
.addField("Roles", message.guild.roles.size, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.addField("Roles", message.guild.roles.size, true) | |
.addField("Roles", message.guild.roles.cache.size, true) | |
For Discord.js V12
.addField("Channels", message.guild.channels.size, true) | ||
.addField("Roles", message.guild.roles.size, true) | ||
.addField("Creation Date", `${message.channel.guild.createdAt.toUTCString().substr(0, 16)} (${checkDays(message.channel.guild.createdAt)})`, true) | ||
.setThumbnail(message.guild.iconURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.setThumbnail(message.guild.iconURL) | |
.setThumbnail(message.guild.iconURL()) | |
For Discord.js V12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may not be staff, but it looks good
.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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.addField('Server region', message.guild.region, true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
let days = Math.floor(diff / 86400000); | ||
return days + (days == 1 ? " day" : " days") + " ago"; | ||
}; | ||
let verifLevels = ["None", "Low", "Medium", "(╯°□°)╯︵ ┻━┻", "┻━┻ミヽ(ಠ益ಠ)ノ彡┻━┻"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Epic
No description provided.