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");
|
|
|
|
|
|
|
|
// run when the bot is added to a guild
|
2021-07-05 04:15:27 +00:00
|
|
|
module.exports = async (client, cluster, worker, ipc, guild) => {
|
|
|
|
logger.log(`[GUILD JOIN] ${guild.name} (${guild.id}) added the bot.`);
|
2021-08-13 03:28:09 +00:00
|
|
|
const guildDB = await db.getGuild(guild.id);
|
|
|
|
if (!guildDB) await db.addGuild(guild);
|
2019-09-13 20:02:41 +00:00
|
|
|
};
|