embed welc

main
suhas 2 years ago
parent 9e2ad127b6
commit 813272caef

@ -2,7 +2,7 @@ import dotenv from 'dotenv'
import { SlashCreator, GatewayServer } from 'slash-create' import { SlashCreator, GatewayServer } from 'slash-create'
import path from 'path' import path from 'path'
import CatLoggr from 'cat-loggr/ts' import CatLoggr from 'cat-loggr/ts'
import { Client, GatewayDispatchEvents, Events, Guild, Message, GuildMember, TextChannel, MessageMentions } from 'discord.js' import { Client, GatewayDispatchEvents, Events, Guild, Message, GuildMember, TextChannel, EmbedBuilder } from 'discord.js'
import { PrismaClient } from '@prisma/client' import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient() const prisma = new PrismaClient()
@ -85,7 +85,16 @@ client.on(Events.GuildMemberAdd, async (m: GuildMember) => {
if (gc.welcome_on) { if (gc.welcome_on) {
const ch = (await m.guild.channels.fetch(gc.welcome_channel)) as TextChannel const ch = (await m.guild.channels.fetch(gc.welcome_channel)) as TextChannel
await ch.send(gc.welcome_message.replace('%USER%', `<@${m.id}>`)) const me = new EmbedBuilder({
title: 'Welcome!',
description: gc.welcome_message.replace('%USER%', `<@${m.id}>`),
footer: {
text: `member #${m.guild.memberCount}`,
icon_url: 'https://www.giantfreakinrobot.com/wp-content/uploads/2022/08/rick-astley.jpg'
},
color: 0x7289da
})
await ch.send({ content: `<@${m.id}>`, embeds: [me] })
} }
}) })

Loading…
Cancel
Save