-
Notifications
You must be signed in to change notification settings - Fork 254
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,45 @@ | ||||||||
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 = { | ||||||||
Comment on lines
+1
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cood |
||||||||
"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" | ||||||||
}; | ||||||||
const embed = new Discord.RichEmbed() | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const embed = new Discord.MessageEmbed() // Discord V12 |
||||||||
.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) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .addField('Server 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For Discord.js V12 |
||||||||
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For Discord.js V12 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. گوزززز |
||||||||
.addField("Channels", message.guild.channels.size, true) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For Discord.js V12 |
||||||||
.addField("Roles", message.guild.roles.size, true) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For Discord.js V12 |
||||||||
.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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For Discord.js V12 |
||||||||
message.channel.send({embed}); | ||||||||
} | ||||||||
|
||||||||
module.exports.help = { | ||||||||
name:"serverinfo" | ||||||||
} |
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