import { ChannelType, Events, GuildMember } from 'discord.js';
import { Client } from '../Structures/Client';
import { EmbedBuilder } from '../Structures/EmbedBuilder';
export default {
event: Events.GuildMemberAdd,
async run (client: Client, member: GuildMember) {
const channel = await member.guild.channels.fetch(client.config.welcomeChannel);
if (channel.type !== ChannelType.GuildText) return;
const embed = new EmbedBuilder({ color: 'green' })
.setTitle(...)
.setThumbnail(...)
.setDescription(...);
await channel.send({ content: `<@${member.id}>`, embeds: [embed] });
const logChannel = await member.guild.channels.fetch(client.config.guildLogChannel);
if (logChannel.type !== ChannelType.GuildText) return;
const logEmbed = new EmbedBuilder({ color: 'green', author: member.user })
.setTitle('Member Joined')
.setDescription(`<@${member.id}>\n\`${member.displayName}\` (${member.id}) has joined the server.`)
.setThumbnail(member.user.displayAvatarURL())
.setTimestamp();
await logChannel.send({ embeds: [logEmbed] });
}
}
import { ChannelType, Events, GuildMember } from 'discord.js';
import { Client } from '../Structures/Client';
import { EmbedBuilder } from '../Structures/EmbedBuilder';
export default {
event: Events.GuildMemberAdd,
async run (client: Client, member: GuildMember) {
const channel = await member.guild.channels.fetch(client.config.welcomeChannel);
if (channel.type !== ChannelType.GuildText) return;
const embed = new EmbedBuilder({ color: 'green' })
.setTitle(...)
.setThumbnail(...)
.setDescription(...);
await channel.send({ content: `<@${member.id}>`, embeds: [embed] });
const logChannel = await member.guild.channels.fetch(client.config.guildLogChannel);
if (logChannel.type !== ChannelType.GuildText) return;
const logEmbed = new EmbedBuilder({ color: 'green', author: member.user })
.setTitle('Member Joined')
.setDescription(`<@${member.id}>\n\`${member.displayName}\` (${member.id}) has joined the server.`)
.setThumbnail(member.user.displayAvatarURL())
.setTimestamp();
await logChannel.send({ embeds: [logEmbed] });
}
}