Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('guildMemberAdd', (member) => {
- if (member.user.bot || member.guild.id !== process.env.GUILD) return
- const token = shortcode(8)
- const welcomemsg = `Welcome to the guild! Make sure you check out the \`#our-server-rules\` channel. \n\n If you accept the code of conduct, please verify your agreement by replying to **this DM** with the verification phrase: \n\n\`I agree to abide by all rules. My token is ${token}.\`\n\n **This message is case-sensitive, and please include the period at the end! ** \n\nQuestions? Get at a staff member in the server or via DM, You will not have full access to the server untill this is complete`
- console.log(`${member.user.username}#${member.user.discriminator} joined! CODE: "${token}"`)
- member.send(welcomemsg)
- member.user.token = token
- })
- const verifymsg = 'I agree to abide by all rules. My token is {token}.'
- client.on('message', (message) => {
- if (message.author.bot || !message.author.token || message.channel.type !== `dm`) return
- if (message.content !== (verifymsg.replace('{token}', message.author.token))) return
- message.channel.send({
- embed: {
- color: Math.floor(Math.random() * (0xFFFFFF + 1)),
- description: completemsg,
- timestamp: new Date(),
- footer: {
- text: `Verification Success`
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement