mirror of
https://github.com/arthur-pbty/bot-discord-coins.git
synced 2026-06-03 23:36:29 +02:00
19 lines
480 B
JavaScript
19 lines
480 B
JavaScript
const { Events } = require("discord.js");
|
|
const db = require("../fonctions/database.js");
|
|
|
|
module.exports = {
|
|
name: Events.GuildCreate,
|
|
async execute(guild) {
|
|
db.run(
|
|
`INSERT OR IGNORE INTO config (guildId, name, value) VALUES (?, ?, ?)`,
|
|
[guild.id, "prefix", "&"],
|
|
);
|
|
guild.members.cache.forEach((member) => {
|
|
db.run(`INSERT OR IGNORE INTO users (guildId, userId) VALUES (?, ?)`, [
|
|
guild.id,
|
|
member.id,
|
|
]);
|
|
});
|
|
},
|
|
};
|