From 5d71e07e292154b66579b225d7152d2099f79cec Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 30 Dec 2024 17:30:52 -0600 Subject: [PATCH] Attempt to add URLs to the bot --- commands/commit-count.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/commands/commit-count.js b/commands/commit-count.js index 3cb4bc2..88ef35a 100644 --- a/commands/commit-count.js +++ b/commands/commit-count.js @@ -125,8 +125,7 @@ module.exports = { const messageList = messageMap.get(date); for (const messageId of messageList) { - // Complicated... But TLDR gives priority to Commit URL, then Attachment, then Reaction - if (verifyReason == '' || verifyReason != 'Attachment' || verifyReason != 'Reaction') { + if (verifyReason == '') { await interaction.channel.messages .fetch(messageId) .then(async (message) => { @@ -134,19 +133,19 @@ module.exports = { /http.:\/\/.*\/(commit|compare|pull)\/.*/g.test(message.content) ) { dateVerified = true; - verifyReason = 'Commit URL'; + verifyReason = '[Commit URL](https://discord.com/channels/${message.guildId}/${message.channel.id}/${message.id})'; } - else if ((message.attachments.size > 0) && verifyReason != 'Commit URL') { + else if ((message.attachments.size > 0)) { dateVerified = true; - verifyReason = 'Attachment'; + verifyReason = '[Attachment](https://discord.com/channels/${message.guildId}/${message.channel.id}/${message.id})'; } - else if ((message.reactions.cache.size > 0) && verifyReason != 'Commit URL' && verifyReason != 'Attachment') { + else if ((message.reactions.cache.size > 0)) { for (const reaction of message.reactions.cache.values()) { const emojiName = reaction._emoji.name; if (emojiName === emojiCheck) { dateVerified = true; - verifyReason = 'Reaction'; + verifyReason = `[Reaction](https://discord.com/channels/${message.guildId}/${message.channel.id}/${message.id})`; break; } }