RtHAitP30D
RtHAitP30D

Reputation: 326

(Discord bot) How do I make a welcome msg when a user joins a discords server (discord.js)?

I am making a discord.js bot and I want to make a welcome msg when someone joins the server.

Here is the basic layout I want:

input: &welcome_channel

get channel id.

input: &welcome_msg

then store this msg.

I have no idea how to get the channel and how to display the welcome message on said channel. Please help.

Upvotes: 0

Views: 402

Answers (1)

Thomas Reichmann
Thomas Reichmann

Reputation: 467

Using the Discord.js library you can use the guildMemberAdd to run a function each time a user joins the server, this event also passes a GuildMember object, using it you should be able to get the server that the user has joined, if there is one the default welcome channel for that server.

Upvotes: 1

Related Questions