Merge pull request #57 from VermiumSifell/52-not-responding-to-any-commands-when-invited-to-guild

🐛now dbGuildFix(guild)
This commit is contained in:
Axel Olausson Holtenäs 2022-03-16 18:26:22 +01:00 committed by GitHub
commit 770dee25ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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({