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
|
// Get all invites
|
||||||
client.invites = [];
|
client.invites = [];
|
||||||
// Update 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 => {
|
guild.invites.fetch().then(guildInvites => {
|
||||||
guildInvites.each(guildInvite => {
|
guildInvites.each(guildInvite => {
|
||||||
client.invites[guildInvite.code] = guildInvite.uses
|
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 => {
|
guild.fetchVanityData().then(vanityData => {
|
||||||
client.invites[vanityData.code] = vanityData.uses
|
client.invites[vanityData.code] = vanityData.uses
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// Register commands
|
// Register commands
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
|
|
Loading…
Reference in a new issue