mrmBot-Matrix/events/guildCreate.js

17 lines
599 B
JavaScript
Raw Normal View History

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");
const client = require("../utils/client.js");
// run when the bot is added to a guild
module.exports = async (guild) => {
logger.log("info", `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot. Owner: ${client.users.get(guild.ownerID).username}#${client.users.get(guild.ownerID).discriminator} (${guild.ownerID})`);
const guildDB = new db.guilds({
2019-10-28 20:21:06 +00:00
id: guild.id,
tags: misc.tagDefaults,
2020-02-27 15:49:32 +00:00
prefix: "&",
warns: {}
2019-10-28 20:21:06 +00:00
});
await guildDB.save();
2019-09-13 20:02:41 +00:00
};