From 221daac4a423a321d1db84b42f25a480a4f44885 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sun, 16 Jan 2022 20:59:08 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/guildCreate.js | 6 ++++-- events/guildDelete.js | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/events/guildCreate.js b/events/guildCreate.js index b2263056..25539b35 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -45,7 +45,7 @@ module.exports = class { const owner = await guild.fetchOwner(); owner.send(messageOptions); - const logsEmbed = new Discord.MessageEmbed() + const embed = new Discord.MessageEmbed() .setAuthor({ name: guild.name, iconURL: guild.iconURL({ @@ -54,6 +54,8 @@ module.exports = class { }) .setColor("#32CD32") .setDescription(`Зашёл на сервер **${guild.name}**. На нём **${guild.members.cache.filter((m) => !m.user.bot).size}** пользователей (из них ${guild.members.cache.filter((m) => m.user.bot).size} ботов)`); - this.client.channels.cache.get(this.client.config.support.logs).send(logsEmbed); + this.client.channels.cache.get(this.client.config.support.logs).send({ + embeds: [embed] + }); } }; \ No newline at end of file diff --git a/events/guildDelete.js b/events/guildDelete.js index 3c511dbc..053fa58c 100644 --- a/events/guildDelete.js +++ b/events/guildDelete.js @@ -6,9 +6,6 @@ module.exports = class { } async run(guild) { - const text = `Вышел с сервера **${guild.name}**. На нём **${guild.members.cache.filter((m) => !m.user.bot).size}** пользователей (из них ${guild.members.cache.filter((m) => m.user.bot).size} ботов)`; - - // Sends log embed in the logs channel const embed = new Discord.MessageEmbed() .setAuthor({ name: guild.name, @@ -17,7 +14,9 @@ module.exports = class { }) }) .setColor("#B22222") - .setDescription(text); - this.client.channels.cache.get(this.client.config.support.logs).send(embed); + .setDescription(`Вышел с сервера **${guild.name}**. На нём **${guild.members.cache.filter((m) => !m.user.bot).size}** пользователей (из них ${guild.members.cache.filter((m) => m.user.bot).size} ботов)`); + this.client.channels.cache.get(this.client.config.support.logs).send({ + embeds: [embed] + }); } }; \ No newline at end of file