Log some stuff
This commit is contained in:
parent
ae85edb0c9
commit
fc21d450c8
9
index.js
9
index.js
|
@ -40,19 +40,26 @@ client.on('ready', async () => {
|
|||
// Get all invites
|
||||
client.invites = [];
|
||||
// Update Invites
|
||||
client.guilds.cache.forEach(guild => { //on bot start, fetch all guilds and fetch all invites to store
|
||||
console.log(`${colors.cyan("[INFO]")} Fetching Invites...`);
|
||||
await client.guilds.cache.forEach(guild => { //on bot start, fetch all guilds and fetch all invites to store
|
||||
thisGuild = []
|
||||
guild.invites.fetch().then(guildInvites => {
|
||||
guildInvites.each(guildInvite => {
|
||||
client.invites[guildInvite.code] = guildInvite.uses
|
||||
thisGuild.push(guildInvite.code)
|
||||
})
|
||||
}).then(() => {
|
||||
console.log(`${colors.cyan("[INFO]")} Fetched ${thisGuild.length} Invites for ${colors.green(guild.name)}`);
|
||||
})
|
||||
guild.fetchVanityData().then(vanityData => {
|
||||
client.invites[vanityData.code] = vanityData.uses
|
||||
}).catch(err => {
|
||||
// Do nothing
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
// Register commands
|
||||
|
||||
const commands = [
|
||||
|
|
Loading…
Reference in a new issue