/[sudobot]/branches/2.x/src/events/guild/GuildCreateEvent.ts
ViewVC logotype

Annotation of /branches/2.x/src/events/guild/GuildCreateEvent.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (hide annotations)
Mon Jul 29 18:52:37 2024 UTC (8 months ago) by rakinar2
File MIME type: application/typescript
File size: 821 byte(s)
chore: add old version archive branches (2.x to 9.x-dev)
1 rakinar2 577 import BaseEvent from '../../utils/structures/BaseEvent';
2     import DiscordClient from '../../client/Client';
3     import { runTimeouts } from '../../utils/setTimeout';
4     import { LogLevel } from '../../services/DebugLogger';
5     import { Guild } from 'discord.js';
6     import BannedGuild from '../../models/BannedGuild';
7    
8     export default class GuildCreateEvent extends BaseEvent {
9     constructor() {
10     super('guildCreate');
11     }
12    
13     async run(client: DiscordClient, guild: Guild) {
14     await client.debugLogger.logLeaveJoin(LogLevel.INFO, `Joined a guild: ${guild.name} [ID: ${guild.id}]`);
15    
16     if (!client.config.props[guild.id]) {
17     await client.debugLogger.logLeaveJoin(LogLevel.CRITICAL, `Unauthorized guild detected: ${guild.name} [ID: ${guild.id}]`);
18     await guild.leave();
19     }
20     }
21     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26