Fix a bunch of linter errors
diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index 148cdb7..c83512c 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -2,15 +2,29 @@
export async function callback(client, oldMessage, newMessage) {
if (newMessage.author.id === client.user.id) return;
- const { log, NucleusColors, entry, renderUser, renderDelta, renderNumberDelta, renderChannel } = newMessage.channel.client.logger;
+ const {
+ log,
+ NucleusColors,
+ entry,
+ renderUser,
+ renderDelta,
+ renderNumberDelta,
+ renderChannel
+ } = newMessage.channel.client.logger;
newMessage.reference = newMessage.reference || {};
let newContent = newMessage.cleanContent.replaceAll("`", "‘");
let oldContent = oldMessage.cleanContent.replaceAll("`", "‘");
let attachmentJump = "";
- const config = (await client.database.guilds.read(newMessage.guild.id)).logging.attachments.saved[newMessage.channel.id + newMessage.id];
- if (config) { attachmentJump = ` [[View attachments]](${config})`; }
+ const config = (await client.database.guilds.read(newMessage.guild.id))
+ .logging.attachments.saved[newMessage.channel.id + newMessage.id];
+ if (config) {
+ attachmentJump = ` [[View attachments]](${config})`;
+ }
if (newContent === oldContent) {
- if (!oldMessage.flags.has("CROSSPOSTED") && newMessage.flags.has("CROSSPOSTED")) {
+ if (
+ !oldMessage.flags.has("CROSSPOSTED") &&
+ newMessage.flags.has("CROSSPOSTED")
+ ) {
const data = {
meta: {
type: "messageAnnounce",
@@ -25,14 +39,35 @@
},
list: {
messageId: entry(newMessage.id, `\`${newMessage.id}\``),
- sentBy: entry(newMessage.author.id, renderUser(newMessage.author)),
- sentIn: entry(newMessage.channel.id, renderChannel(newMessage.channel)),
- sent: entry(new Date(newMessage.createdTimestamp), renderDelta(new Date(newMessage.createdTimestamp))),
- published: entry(new Date(newMessage.editedTimestamp), renderDelta(new Date(newMessage.editedTimestamp))),
- mentions: renderNumberDelta(oldMessage.mentions.users.size, newMessage.mentions.users.size),
+ sentBy: entry(
+ newMessage.author.id,
+ renderUser(newMessage.author)
+ ),
+ sentIn: entry(
+ newMessage.channel.id,
+ renderChannel(newMessage.channel)
+ ),
+ sent: entry(
+ new Date(newMessage.createdTimestamp),
+ renderDelta(new Date(newMessage.createdTimestamp))
+ ),
+ published: entry(
+ new Date(newMessage.editedTimestamp),
+ renderDelta(new Date(newMessage.editedTimestamp))
+ ),
+ mentions: renderNumberDelta(
+ oldMessage.mentions.users.size,
+ newMessage.mentions.users.size
+ ),
attachments: entry(
- renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size),
- renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size) + attachmentJump
+ renderNumberDelta(
+ oldMessage.attachments.size,
+ newMessage.attachments.size
+ ),
+ renderNumberDelta(
+ oldMessage.attachments.size,
+ newMessage.attachments.size
+ ) + attachmentJump
)
},
hidden: {
@@ -42,9 +77,13 @@
return log(data);
}
}
- if (!newMessage.editedTimestamp) { return; }
- if (newContent.length > 256) newContent = newContent.substring(0, 253) + "...";
- if (oldContent.length > 256) oldContent = oldContent.substring(0, 253) + "...";
+ if (!newMessage.editedTimestamp) {
+ return;
+ }
+ if (newContent.length > 256)
+ newContent = newContent.substring(0, 253) + "...";
+ if (oldContent.length > 256)
+ oldContent = oldContent.substring(0, 253) + "...";
const data = {
meta: {
type: "messageUpdate",
@@ -55,24 +94,49 @@
timestamp: newMessage.editedTimestamp
},
separate: {
- start: (oldContent ? `**Before:**\n\`\`\`\n${oldContent}\n\`\`\`\n` : "**Before:** *Message had no content*\n") +
- (newContent ? `**After:**\n\`\`\`\n${newContent}\n\`\`\`` : "**After:** *Message had no content*"),
+ start:
+ (oldContent
+ ? `**Before:**\n\`\`\`\n${oldContent}\n\`\`\`\n`
+ : "**Before:** *Message had no content*\n") +
+ (newContent
+ ? `**After:**\n\`\`\`\n${newContent}\n\`\`\``
+ : "**After:** *Message had no content*"),
end: `[[Jump to message]](${newMessage.url})`
},
list: {
messageId: entry(newMessage.id, `\`${newMessage.id}\``),
sentBy: entry(newMessage.author.id, renderUser(newMessage.author)),
- sentIn: entry(newMessage.channel.id, renderChannel(newMessage.channel)),
- sent: entry(new Date(newMessage.createdTimestamp), renderDelta(new Date(newMessage.createdTimestamp))),
- edited: entry(new Date(newMessage.editedTimestamp), renderDelta(new Date(newMessage.editedTimestamp))),
- mentions: renderNumberDelta(oldMessage.mentions.users.size, newMessage.mentions.users.size),
+ sentIn: entry(
+ newMessage.channel.id,
+ renderChannel(newMessage.channel)
+ ),
+ sent: entry(
+ new Date(newMessage.createdTimestamp),
+ renderDelta(new Date(newMessage.createdTimestamp))
+ ),
+ edited: entry(
+ new Date(newMessage.editedTimestamp),
+ renderDelta(new Date(newMessage.editedTimestamp))
+ ),
+ mentions: renderNumberDelta(
+ oldMessage.mentions.users.size,
+ newMessage.mentions.users.size
+ ),
attachments: entry(
- renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size),
- renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size) + attachmentJump
+ renderNumberDelta(
+ oldMessage.attachments.size,
+ newMessage.attachments.size
+ ),
+ renderNumberDelta(
+ oldMessage.attachments.size,
+ newMessage.attachments.size
+ ) + attachmentJump
),
repliedTo: entry(
newMessage.reference.messageId || null,
- newMessage.reference.messageId ? `[[Jump to message]](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${newMessage.reference.messageId})` : "None"
+ newMessage.reference.messageId
+ ? `[[Jump to message]](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${newMessage.reference.messageId})`
+ : "None"
)
},
hidden: {
@@ -80,4 +144,4 @@
}
};
log(data);
-}
\ No newline at end of file
+}