Advertisement
ninja-gen

Verify

Jan 27th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. client.on('guildMemberAdd', (member) => {
  2.     if (member.user.bot || member.guild.id !== process.env.GUILD) return
  3.     const token = shortcode(8)
  4.     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`
  5.     console.log(`${member.user.username}#${member.user.discriminator} joined! CODE: "${token}"`)
  6.     member.send(welcomemsg)
  7.     member.user.token = token
  8. })
  9.  
  10. const verifymsg = 'I agree to abide by all rules. My token is {token}.'
  11.  
  12. client.on('message', (message) => {
  13.     if (message.author.bot || !message.author.token || message.channel.type !== `dm`) return
  14.     if (message.content !== (verifymsg.replace('{token}', message.author.token))) return
  15.     message.channel.send({
  16.         embed: {
  17.             color: Math.floor(Math.random() * (0xFFFFFF + 1)),
  18.             description: completemsg,
  19.             timestamp: new Date(),
  20.             footer: {
  21.                 text: `Verification Success`
  22.             }
  23.         }
  24.     })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement