Creating a join/leave message

How would I create one? I'm trying to use guildMemberAdd
70 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
wdym
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ok
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
guide Creating Your Bot: Event handling read more
SuperPEKKA336
SuperPEKKA336OP2y ago
good point wait when am i passing client
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
i already had it open
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
huh wait so what should i be doing?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
im getting client
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
but then i wont need to define it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ah yeah nvm bc i copied the code from ym ready.js *my
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
i did it should i also pass client from index as well?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ah ok
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
so now i do channel.send(embed) right?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
yeah i was shortening it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
wait wouldnt EMBEDS neeto be in an array?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
cool
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
uh crap can i do member.client.interactions?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
then how would i get channel?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
k and quick question if i wanted to dynamiclly include a user's username in teh welcome msg i would need to update it in the file right?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
bc i have all my embeds in a JSON
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
so i would do const embed = EMBEDS.WELCOME; embed = {"description": "Welcome to the server $(username here)");
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ah ok
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
i18n?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ah o k
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
Thanks for the help 🙂 actually one last question how would i mention the user w/o that above?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
how would i get teh id *the
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ye nvm member.id im stupid ty didnt rk *work
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
i used my alt to leave and join the server but the whole file was never run
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ah where would i put it?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
nvm perfect ty and and for userLeave should i make a new file or use the same file?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
ok tysm should i make a folder with join/leave/banned? and how would i add a role to when a user joins? member.roles.add(role);? and could i do const role = member.interaction.options.getRole('905893175774822441');? ah
Want results from more Discord servers?
Add your server