jei
jei
DIAdiscord.js - Imagine an app
Created by jei on 11/3/2024 in #djs-questions
GuildMemberAdded not working
import { Events, GuildMember, TextChannel } from "discord.js";
import Event from "../../classes/Event";
import OopsieClient from "../../classes/OopsieClient";
import { prisma } from "../../lib/prisma";

export default class GuildMemberAdd extends Event {
constructor(client: OopsieClient) {
super(client, { name: Events.GuildMemberAdd, description: "Guild Member Added Event", once: true });
}

async execute(member: GuildMember) {
await prisma.user.create({
data: {
name: member.user.username,
level: 1,
tokens: 100,
},
});
}
}
import { Events, GuildMember, TextChannel } from "discord.js";
import Event from "../../classes/Event";
import OopsieClient from "../../classes/OopsieClient";
import { prisma } from "../../lib/prisma";

export default class GuildMemberAdd extends Event {
constructor(client: OopsieClient) {
super(client, { name: Events.GuildMemberAdd, description: "Guild Member Added Event", once: true });
}

async execute(member: GuildMember) {
await prisma.user.create({
data: {
name: member.user.username,
level: 1,
tokens: 100,
},
});
}
}
whenever I ask someone to join, it doesnt run and I cannot trace why
35 replies