/[sudobot]/trunk/src/events/guild/GuildCreateEvent.ts
ViewVC logotype

Contents of /trunk/src/events/guild/GuildCreateEvent.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 344 - (show annotations)
Mon Jul 29 17:29:40 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 715 byte(s)
chore: eslint autofix
1 import BaseEvent from '../../utils/structures/BaseEvent';
2 import DiscordClient from '../../client/Client';
3 import { LogLevel } from '../../services/DebugLogger';
4 import { Guild } from 'discord.js';
5
6 export default class GuildCreateEvent extends BaseEvent {
7 constructor() {
8 super('guildCreate');
9 }
10
11 async run(client: DiscordClient, guild: Guild) {
12 await client.debugLogger.logLeaveJoin(LogLevel.INFO, `Joined a guild: ${guild.name} [ID: ${guild.id}]`);
13
14 if (!client.config.props[guild.id]) {
15 await client.debugLogger.logLeaveJoin(LogLevel.CRITICAL, `Unauthorized guild detected: ${guild.name} [ID: ${guild.id}]`);
16 await guild.leave();
17 }
18 }
19 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26