audit fix; add n. guilds stat

This commit is contained in:
Yusur 2025-08-19 17:00:01 +02:00
parent c6d37cd81e
commit a6ea1188b8
7 changed files with 217 additions and 157 deletions

View file

@ -16,12 +16,14 @@ limitations under the License.
import "./initConfig";
import { GatewayIntentBits, Events, Interaction, ChatInputCommandInteraction } from 'discord.js';
import { GatewayIntentBits, Events, Interaction, ChatInputCommandInteraction, Guild } from 'discord.js';
import { MyClient } from './client';
import commandList from './commandList';
import chalk from 'chalk';
const guildDetail = !!process.env.GUILD_DETAIL;
const client = new MyClient({
intents: [
GatewayIntentBits.Guilds
@ -47,6 +49,10 @@ client.on(Events.InteractionCreate, async (interaction: Interaction) => {
client.once(Events.ClientReady, async () => {
console.log(`Logged in as ${chalk.bold(client.user.tag)}`);
console.log(`Currently in ${chalk.bold(client.guilds.cache.size)} guilds` + (guildDetail? ':' : `; rerun with GUILD_DETAIL_SHOW=1 for details`));
if (guildDetail) {
console.log(client.guilds.cache.map((x: Guild) => `* ${chalk.bold(x.name)} ${chalk.grey('(ID: ')}${chalk.green(x.id)}${chalk.grey(`, ${x.memberCount} members)`)}`).join('\n'));
}
})
client.login(process.env.TOKEN);
export default client;