diff --git a/src/Events/BotEvents/messageEvents/messageReactionAdd/log.ts b/src/Events/BotEvents/messageEvents/messageReactionAdd/log.ts index dbcdf7b49..d34b5f606 100644 --- a/src/Events/BotEvents/messageEvents/messageReactionAdd/log.ts +++ b/src/Events/BotEvents/messageEvents/messageReactionAdd/log.ts @@ -15,43 +15,18 @@ export default async ( const lan = language.events.logs.reaction; const con = msg.client.util.constants.events.logs.reaction; const files: Discord.AttachmentPayload[] = []; - const embeds: Discord.APIEmbed[] = []; const embed: Discord.APIEmbed = { - author: { - icon_url: con.create, - name: lan.nameAdd, - }, + author: { icon_url: con.create, name: lan.nameAdd }, description: lan.descAdded(reaction.emoji, user, msg), fields: [], color: CT.Colors.Success, timestamp: new Date().toISOString(), - }; - - embeds.push(embed); - - if (msg.reactions.cache?.size) { - embeds.push({ - title: lan.reactions, - description: msg.reactions.cache - .map( - (r) => - `\`${msg.client.util.spaces(`${r.count ?? 1}`, 5)}\` ${ - (reaction.emoji.id && r.emoji.id && reaction.emoji.id === r.emoji.id) || - (!reaction.emoji.id && reaction.emoji.name === r.emoji.name) - ? ` ${msg.client.util.constants.standard.getEmote(msg.client.util.emotes.plusBG)}` - : ` ${msg.client.util.constants.standard.getEmote(msg.client.util.emotes.invis)}` - } ${language.languageFunction.getEmote(r.emoji)}`, - ) - .join(''), - color: CT.Colors.Ephemeral, - }); - } - - embed.thumbnail = { - url: `attachment://${msg.client.util.getNameAndFileType( - msg.client.util.constants.standard.emoteURL(reaction.emoji), - )}`, + thumbnail: { + url: `attachment://${msg.client.util.getNameAndFileType( + msg.client.util.constants.standard.emoteURL(reaction.emoji), + )}`, + }, }; const attachment = ( @@ -62,5 +37,9 @@ export default async ( if (attachment) files.push(...attachment); - await msg.client.util.send({ id: channels, guildId: msg.guildId }, { embeds, files }, 10000); + await msg.client.util.send( + { id: channels, guildId: msg.guildId }, + { embeds: [embed], files }, + 10000, + ); }; diff --git a/src/Events/BotEvents/messageEvents/messageReactionRemove/log.ts b/src/Events/BotEvents/messageEvents/messageReactionRemove/log.ts index aae9bfd77..6f56e2d3a 100644 --- a/src/Events/BotEvents/messageEvents/messageReactionRemove/log.ts +++ b/src/Events/BotEvents/messageEvents/messageReactionRemove/log.ts @@ -15,46 +15,18 @@ export default async ( const lan = language.events.logs.reaction; const con = reaction.client.util.constants.events.logs.reaction; const files: Discord.AttachmentPayload[] = []; - const embeds: Discord.APIEmbed[] = []; const embed: Discord.APIEmbed = { - author: { - icon_url: con.remove, - name: lan.nameRemove, - }, + author: { icon_url: con.remove, name: lan.nameRemove }, description: lan.descRemoved(reaction.emoji, user, msg), fields: [], color: CT.Colors.Danger, timestamp: new Date().toISOString(), - }; - - embeds.push(embed); - - if (msg.reactions.cache.filter((r) => Number(r.count) !== 0)?.size) { - embeds.push({ - title: lan.reactions, - description: (msg.reactions.cache ?? [{ count: 0, emoji: reaction.emoji }]) - .filter((r) => Number(r.count) !== 0) - ?.map( - (r) => - `\`${reaction.client.util.spaces(`${Number(r.count)}`, 5)}\` ${ - (reaction.emoji.id && r.emoji.id && reaction.emoji.id === r.emoji.id) || - (!reaction.emoji.id && reaction.emoji.name === r.emoji.name) - ? ` ${reaction.client.util.constants.standard.getEmote( - reaction.client.util.emotes.minusBG, - )}` - : ` ${reaction.client.util.constants.standard.getEmote(reaction.client.util.emotes.invis)}` - } ${language.languageFunction.getEmote(r.emoji)}`, - ) - .join(''), - color: CT.Colors.Ephemeral, - }); - } - - embed.thumbnail = { - url: `attachment://${reaction.client.util.getNameAndFileType( - reaction.client.util.constants.standard.emoteURL(reaction.emoji), - )}`, + thumbnail: { + url: `attachment://${reaction.client.util.getNameAndFileType( + reaction.client.util.constants.standard.emoteURL(reaction.emoji), + )}`, + }, }; const attachment = ( @@ -64,5 +36,9 @@ export default async ( )?.[0]; if (attachment) files.push(attachment); - await reaction.client.util.send({ id: channels, guildId: msg.guildId }, { embeds, files }, 10000); + await reaction.client.util.send( + { id: channels, guildId: msg.guildId }, + { embeds: [embed], files }, + 10000, + ); }; diff --git a/src/Events/BotEvents/messageEvents/messageReactionRemoveAll/log.ts b/src/Events/BotEvents/messageEvents/messageReactionRemoveAll/log.ts index a1af6f19d..0e694efae 100644 --- a/src/Events/BotEvents/messageEvents/messageReactionRemoveAll/log.ts +++ b/src/Events/BotEvents/messageEvents/messageReactionRemoveAll/log.ts @@ -16,11 +16,7 @@ export default async ( const files: Discord.AttachmentPayload[] = []; const embed: Discord.APIEmbed = { - author: { - name: lan.nameRemoveAll, - icon_url: con.remove, - url: msg.url, - }, + author: { name: lan.nameRemoveAll, icon_url: con.remove, url: msg.url }, description: lan.descRemovedAll(msg), color: CT.Colors.Danger, fields: [], @@ -37,11 +33,16 @@ export default async ( r.emoji, )}`, ) - .join('\n'), + .join(''), }); const users = msg.client.util.txtFileWriter( - reactions.map((r) => r.users.cache.map(String).join(', ')).join('\n'), + reactions + .map( + (r) => + `${language.languageFunction.getEmote(r.emoji)}\n- ${r.users.cache.map((u) => language.languageFunction.getUser(u)).join('')}`, + ) + .join('\n\n'), undefined, lan.reactions, ); diff --git a/src/Events/BotEvents/messageEvents/messageReactionRemoveEmoji/log.ts b/src/Events/BotEvents/messageEvents/messageReactionRemoveEmoji/log.ts index dd356b867..c400351a1 100644 --- a/src/Events/BotEvents/messageEvents/messageReactionRemoveEmoji/log.ts +++ b/src/Events/BotEvents/messageEvents/messageReactionRemoveEmoji/log.ts @@ -41,7 +41,7 @@ export default async (reaction: Discord.MessageReaction, msg: Discord.Message