diff --git a/event/listeners/ready.js b/event/listeners/ready.js index 673f9b8a..965794ea 100644 --- a/event/listeners/ready.js +++ b/event/listeners/ready.js @@ -1,5 +1,5 @@ const { Listener } = require('discord-akairo'); -const { prefix, statsChannel } = require('../../config.json'); +const { prefix, statsChannel, botID } = require('../../config.json'); const game = require('../../json/status/playing.json'); const watch = require('../../json/status/watching.json'); @@ -33,12 +33,28 @@ class ReadyListener extends Listener { this.client.user.setActivity(`${status} | ${prefix[0]} help`, { type: 'PLAYING' }); } - // Send stats to the 'stats' channel in the support server if its not the test bot - if (this.client.user.id == 377563711927484418) { + if (this.client.user.id == botID) { const channel = this.client.channels.get(statsChannel); channel.send(`Ready to serve in ${this.client.channels.size} channels on ${this.client.guilds.size} servers, for a total of ${this.client.users.size} users. ${this.client.readyAt}`); } + /* + //Fetch messages in every channel ( so they can still enter starboard in case of reboot) + let array = []; + let channels = this.client.channels.array(); + for (const channel of channels.values()) { + array.push(channel.id); + } + + for (let i = 0; i < this.client.channels.size; i++) { + let channel = this.client.channels.get(array[i]); + if (channel.messages) { + channel.messages.fetch({ limit: 10 }) + .then(messages => console.log(`Received ${messages.size} messages`)) + .catch(err => console.error(err)); + } + } + */ } }