2019-11-05 15:52:46 +00:00
|
|
|
const db = require("../utils/database.js");
|
2019-09-13 20:02:41 +00:00
|
|
|
const logger = require("../utils/logger.js");
|
|
|
|
const misc = require("../utils/misc.js");
|
|
|
|
|
|
|
|
// run when the bot is added to a guild
|
|
|
|
module.exports = async (guild) => {
|
2020-11-05 21:40:18 +00:00
|
|
|
logger.log("info", `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot.`);
|
2020-07-27 00:52:13 +00:00
|
|
|
const guildDB = new db.guilds({
|
|
|
|
id: guild.id,
|
|
|
|
tags: misc.tagDefaults,
|
2020-09-03 22:48:28 +00:00
|
|
|
prefix: process.env.PREFIX,
|
2020-07-27 00:52:13 +00:00
|
|
|
warns: {},
|
2020-09-03 19:26:39 +00:00
|
|
|
disabledChannels: [],
|
|
|
|
tagsDisabled: false
|
2020-07-27 00:52:13 +00:00
|
|
|
});
|
|
|
|
await guildDB.save();
|
2020-11-05 21:40:18 +00:00
|
|
|
return guildDB;
|
2019-09-13 20:02:41 +00:00
|
|
|
};
|