🐛now dbGuildFix(guild)

This commit is contained in:
Axel Olausson Holtenäs 2022-03-16 17:30:17 +01:00
parent 566b2997bb
commit 5f6138cb55
No known key found for this signature in database
GPG key ID: E3AE7E194AE017ED

View file

@ -1,4 +1,4 @@
const { guilds, apis } = require('../helpers/database/models');
const { dbGuildFix } = require('../helpers');
module.exports = {
name: 'guildCreate',
@ -6,17 +6,7 @@ module.exports = {
// Destructure client
const { client } = guild;
// Create guild object if not already created
const guildExist = await guilds.findOne({ guildId: guild.id });
if (!guildExist) {
await guilds.create({ guildId: guild.id });
}
const apiExist = await apis.findOne({ guildId: guild.id });
if (!apiExist) {
apis.create({ guildId: guild.id });
}
await dbGuildFix(guild);
// Set client status
await client.user.setPresence({