Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RoeeLupo
Copy link

No description provided.

@ersu98
Copy link

ersu98 commented Aug 30, 2018

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())
.setThumbnail(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)
.setThumbnail(message.guild.iconURL)

@RoeeLupo
Copy link
Author

Sorry, this code was originally made for Discord.js version 12.0.0-dev, in this version it needs to be iconURL() and avatarURL()

@RoeeLupo
Copy link
Author

I've fixed it

Copy link

@ipadpuppydogdude1 ipadpuppydogdude1 left a 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

Copy link

@Jaylxnn Jaylxnn left a 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

Comment on lines +1 to +11
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 = {

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()

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true)
.addField("Verification Level", message.guild.verificationLevel, true)

For Discord.js V12

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.setThumbnail(message.guild.iconURL)
.setThumbnail(message.guild.iconURL())

For Discord.js V12

Copy link

@Kyro3400 Kyro3400 left a 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)

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)

Repository owner deleted a comment from timmy0909 Apr 9, 2021
Repository owner deleted a comment from ClankoreTheGreat Apr 9, 2021
Copy link

@azawat7 azawat7 left a 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", "(╯°□°)╯︵ ┻━┻", "┻━┻ミヽ(ಠ益ಠ)ノ彡┻━┻"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epic

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

Successfully merging this pull request may close these issues.