Intégration MongoDB + Fix export et amp
This commit is contained in:
14
src/events/client/guildCreate.ts
Executable file
14
src/events/client/guildCreate.ts
Executable file
@@ -0,0 +1,14 @@
|
||||
import { Events, Guild } from 'discord.js'
|
||||
import dbGuildInit from '../../utils/dbGuildInit'
|
||||
|
||||
export default {
|
||||
name: Events.GuildCreate,
|
||||
async execute(guild: Guild) {
|
||||
console.log(`Joined ${guild.name} with ${guild.memberCount} members`)
|
||||
|
||||
let guildProfile = await dbGuildInit(guild)
|
||||
if (!guildProfile) return console.log(`An error occured while initializing database data for **${guild.name}** !`)
|
||||
|
||||
console.log(`Database data for new guild **${guildProfile.guildName}** successfully initialized !`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user