🩹 fix api config
This commit is contained in:
parent
bdcce1ee72
commit
e60c205097
2 changed files with 8 additions and 8 deletions
|
@ -219,10 +219,6 @@ module.exports = async (client) => {
|
|||
getActualSet: async ({ guild, user }) => {
|
||||
const api = await apis.findOne({ guildId: guild.id });
|
||||
|
||||
if (!api) {
|
||||
apis.create({ guildId: guild.id });
|
||||
}
|
||||
|
||||
return api.url;
|
||||
},
|
||||
setNew: async ({ guild, newData }) => {
|
||||
|
@ -242,9 +238,7 @@ module.exports = async (client) => {
|
|||
optionType: DBD.formTypes.input('1'),
|
||||
getActualSet: async ({ guild, user }) => {
|
||||
const api = await apis.findOne({ guildId: guild.id });
|
||||
if (!api) {
|
||||
apis.create({ guildId: guild.id });
|
||||
}
|
||||
|
||||
return api.token;
|
||||
},
|
||||
setNew: async ({ guild, newData }) => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const guilds = require('../helpers/database/models/guildSchema');
|
||||
const { guilds, apis } = require('../helpers/database/models');
|
||||
|
||||
module.exports = {
|
||||
name: 'guildCreate',
|
||||
|
@ -12,6 +12,12 @@ module.exports = {
|
|||
await guilds.create({ guildId: guild.id });
|
||||
}
|
||||
|
||||
const apiExist = await apis.findOne({ guildId: guild.id });
|
||||
|
||||
if (!apiExist) {
|
||||
apis.create({ guildId: guild.id });
|
||||
}
|
||||
|
||||
// Set client status
|
||||
await client.user.setPresence({
|
||||
activities: [
|
||||
|
|
Loading…
Add table
Reference in a new issue