bot/src/events/guildCreate.ts

19 lines
466 B
TypeScript
Raw Normal View History

2020-02-01 23:23:36 +00:00
import { Event } from '@events/Event';
import { Guild } from 'discord.js';
2020-01-13 22:38:12 +00:00
2020-02-01 23:23:36 +00:00
export const event = new Event(
'guildCreate',
async (lifeguard, guild: Guild) => {
await lifeguard.db.guilds.insertOne({ id: guild.id, config: {} });
if (lifeguard.user) {
lifeguard.user.setPresence({
activity: {
name: `${lifeguard.users.size} people in the pool`,
type: 'WATCHING',
},
status: 'online',
});
}
2020-01-13 22:38:12 +00:00
}
2020-02-01 23:23:36 +00:00
);