From cd2761514741b527b6685e0b672e58af75c70803 Mon Sep 17 00:00:00 2001 From: CringeJan Date: Sat, 28 Nov 2020 13:57:44 +0000 Subject: [PATCH] =?UTF-8?q?Smazat=20=E2=80=9Eshitposts.js=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shitposts.js | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 shitposts.js diff --git a/shitposts.js b/shitposts.js deleted file mode 100644 index a2775c2..0000000 --- a/shitposts.js +++ /dev/null @@ -1,37 +0,0 @@ -const Discord = require('discord.js'); -const client = require('./index').client; - -const tChannelID = '740207856288268289'; -const emoji = '719181283393142786'; - -client.on('messageReactionAdd', async function(reaction, user) { - - // Some people abused this "feature", to it is temporarily disabled. - return; - - let publish = false; - - // Fetch partials - if (reaction.partial) reaction = await reaction.fetch(); - if (user.partial) user = await user.fetch(); - - if (user.bot && user.id != client.user.id) return; - if (reaction.message.channel.id != tChannelID) return; - if (reaction.message.channel.type != 'news') return; - - if (reaction.emoji.id != emoji) return; - - const count = reaction.message.reactions.cache.filter(e => e.emoji.id == emoji).array()[0].count; - - if (count == 3) publish = true; // When the message has an attachment, publish it at 3 upvotes, else at 5 - - // This publishes the message using a direct API call. (Copied from https://github.com/Forcellrus/Discord-Auto-Publisher/blob/master/bot.js) - if (!publish) return; - reaction.message.react(client.emojis.cache.get('730053273561727063')).catch(); - await fetch(`https://discord.com/api/v6/channels/${reaction.message.channel.id}/messages/${reaction.message.id}/crosspost`, { - method: 'POST', - headers: { - Authorization: `Bot ${require('./config.json').token}`, - }, - }); -}); \ No newline at end of file