Log some stuff

This commit is contained in:
Christopher Cookman 2024-06-16 22:09:23 -06:00
parent ae85edb0c9
commit fc21d450c8
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -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 = [