Фиксы

This commit is contained in:
JonnyBro 2022-01-04 01:52:31 +05:00
parent 46a0911f1c
commit b3596dd64f
3 changed files with 5 additions and 3 deletions

View file

@ -97,6 +97,7 @@ userSchema.method("genApiToken", async function() {
userSchema.method("getAchievements", async function() { userSchema.method("getAchievements", async function() {
const canvas = Canvas.createCanvas(1800, 250), const canvas = Canvas.createCanvas(1800, 250),
ctx = canvas.getContext("2d"); ctx = canvas.getContext("2d");
const images = [ const images = [
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.work.achieved ? "_colored" : ""}1.png`), await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.work.achieved ? "_colored" : ""}1.png`),
await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.firstCommand.achieved ? "_colored" : ""}2.png`), await Canvas.loadImage(`./assets/img/achievements/achievement${this.achievements.firstCommand.achieved ? "_colored" : ""}2.png`),

View file

@ -85,9 +85,9 @@ class Profile extends Command {
const buffer = userData.getAchievements(); const buffer = userData.getAchievements();
message.channel.send({ message.channel.send({
embeds: [profileEmbed], embeds: [profileEmbed],
files: [{ // files: [{
attachment: buffer // attachment: buffer
}] // }]
}); // Send the embed in the current channel }); // Send the embed in the current channel
} }
}; };

View file

@ -20,6 +20,7 @@ class Staff extends Command {
async run(message, args, data) { async run(message, args, data) {
await message.guild.members.fetch(); await message.guild.members.fetch();
const administrators = message.guild.members.cache.filter((m) => m.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR) && !m.user.bot); const administrators = message.guild.members.cache.filter((m) => m.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR) && !m.user.bot);
console.log(administrators[0])
const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(Discord.Permissions.FLAGS.MANAGE_MESSAGES) && !m.user.bot); const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(Discord.Permissions.FLAGS.MANAGE_MESSAGES) && !m.user.bot);
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ .setAuthor({