Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. client.on('message', message =>{
  2. if (message.content.startsWith(prefixz + "verify")) {
  3. if (message.member.roles.some(role => role.name === 'Verified')) {
  4. let num = Math.floor((Math.random() * 4783) + 10);
  5. var embedOne = new Discord.RichEmbed()
  6. .setColor('#32CD32')
  7. .addField('1 user was successfully verified. :white_check_mark:', 'Wanna take a look on the rules? Use -rules command')
  8. message.delete()
  9. message.channel.send(`Please type the following number : **${num}**`).then(m => {
  10. message.channel.awaitMessages(res => res.content == `${num}`, {
  11. max: 1,
  12. time: 60000,
  13. errors: ['time'],
  14. }).then(collected => {
  15.  
  16. message.author.sendMessage(`Hey, ${message.author} you were automatically verified by me! You now have permissions to the main server channels. \n \nEnjoy! :wink:`);
  17. message.channel.sendEmbed(embedOne);
  18. message.member.addRole(message.guild.roles.find(c => c.name == "Verified"));
  19. }).catch(() => {
  20. m.edit(`You took to long to type the number.\nRe-type the command again if you want to verify yourself.`).then(m2 => m.delete(15000));
  21. });
  22. })
  23. }
  24. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement