This commit is contained in:
Lukian LEIZOUR 2024-08-17 19:32:16 +02:00
parent 4cb2217898
commit 8a23e86b12
5 changed files with 89 additions and 1 deletions

18
src/events/guildCreate.ts Normal file
View file

@ -0,0 +1,18 @@
import { Events, Guild } from "discord.js";
import { connectToDb, getguild, addGuild } from "../libs/mysql.js";
export default {
name: Events.GuildCreate,
async execute(guild: Guild) {
const connection = await connectToDb();
const guild_obj: any[] = await getguild(connection, guild.id);
connection.end()
if (guild_obj[0]) {
return;
}
addGuild(connection, guild.id);
},
};