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