From 37cf1d602f3bcb9eb801eeed5c5d3a6d5e221865 Mon Sep 17 00:00:00 2001 From: Ayfri Date: Sun, 22 Nov 2020 17:47:48 +0100 Subject: [PATCH] Prettified code. --- README.md | 2 +- main.js | 11 ++++++++--- package-lock.json | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 73ebf9f..cb7ad24 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ A npm package to fetch all the messages from a guild or a channel. - ## How to use it ⚠️ READ BEFORE USING ⚠️
@@ -22,4 +21,5 @@ const fetchedChannelMessages = await require('discord-fetch-messages').fetchChan ``` Note : + > Node.js > 14 is required. diff --git a/main.js b/main.js index 6334e93..c0130f9 100644 --- a/main.js +++ b/main.js @@ -42,10 +42,15 @@ async function fetchChannelMessages(client, channel) { async function fetchGuildMessages(client, guildID) { const m = []; const channels = client.guilds.cache.get(guildID).channels.cache.filter(c => c.isText()); - console.log(`Getting the messages from these channels : ${channels.map(c => `#${c.name}`).sort().join('\n')}`); - + console.log( + `Getting the messages from these channels : ${channels + .map(c => `#${c.name}`) + .sort() + .join('\n')}` + ); + for (const channel of channels.array()) { - console.log(`Getting messages from : #${channel.name}.`) + console.log(`Getting messages from : #${channel.name}.`); const messages = await fetchChannelMessages(client, channel); if (!m.find(c => c.id === channel.id)) diff --git a/package-lock.json b/package-lock.json index 971a0e5..4d3d436 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "discord-fetch-messages", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "discord-fetch-messages", - "version": "1.1.1", + "version": "1.1.2", "devDependencies": { "discord.js": "^12.5.0", "prettier": "^2.2.0", @@ -218,5 +218,5 @@ } } } - }, + } }