Attempt to add URLs to the bot
This commit is contained in:
parent
da0accc304
commit
5d71e07e29
1 changed files with 6 additions and 7 deletions
|
@ -125,8 +125,7 @@ module.exports = {
|
||||||
|
|
||||||
const messageList = messageMap.get(date);
|
const messageList = messageMap.get(date);
|
||||||
for (const messageId of messageList) {
|
for (const messageId of messageList) {
|
||||||
// Complicated... But TLDR gives priority to Commit URL, then Attachment, then Reaction
|
if (verifyReason == '') {
|
||||||
if (verifyReason == '' || verifyReason != 'Attachment' || verifyReason != 'Reaction') {
|
|
||||||
await interaction.channel.messages
|
await interaction.channel.messages
|
||||||
.fetch(messageId)
|
.fetch(messageId)
|
||||||
.then(async (message) => {
|
.then(async (message) => {
|
||||||
|
@ -134,19 +133,19 @@ module.exports = {
|
||||||
/http.:\/\/.*\/(commit|compare|pull)\/.*/g.test(message.content)
|
/http.:\/\/.*\/(commit|compare|pull)\/.*/g.test(message.content)
|
||||||
) {
|
) {
|
||||||
dateVerified = true;
|
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;
|
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()) {
|
for (const reaction of message.reactions.cache.values()) {
|
||||||
const emojiName = reaction._emoji.name;
|
const emojiName = reaction._emoji.name;
|
||||||
|
|
||||||
if (emojiName === emojiCheck) {
|
if (emojiName === emojiCheck) {
|
||||||
dateVerified = true;
|
dateVerified = true;
|
||||||
verifyReason = 'Reaction';
|
verifyReason = `[Reaction](https://discord.com/channels/${message.guildId}/${message.channel.id}/${message.id})`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue