Advertisement
Guest User

Verification Command Roblox

a guest
Apr 2nd, 2020
1,352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. const Discord = require("discord.js")
  2. const rbx = require("roblox-js")
  3.  
  4. exports.run = async (Client, message, args) => {
  5. let S = Client.settings.get(message.guild.id)
  6.  
  7. const db = Client.db.get(message.author.id)
  8.  
  9. Client.db.set(message.author.id, Client.config.users)
  10. let msg = await message.channel.send("Awaiting Prompt")
  11.  
  12. if(db.id != "none") {
  13. message.channel.send(`You are already verified as ${db.username}. Role has been given`)
  14. return message.member.roles.add(message.guild.roles.find(r => r.name == "Verified"))
  15. }
  16.  
  17.  
  18.  
  19. function makeid() {
  20. var text = "";
  21. var selectFruit = ['😀','😁','😂','🤣','😃','😄','😅','😆','😉','😲','😝','🤑','🤯','😭','😑','😶','😋','🙆','👉','👇','🧠','💼','👮🏻','👍🏼','👎🏼','🐵','🌨','☁️','💧','🎬','🎧','🎮','🎲','🏅','🥇','🥈','🥉','🏆','🏒','🍎','🍫','🍿','🍪','🥛','🍽','🍴','🐑','🦀','🐔','🐭','🦊','🐧','🐞','🌍','🌏','🌕','🌖','🌚','🌝','🌵','🎄','🌲','☀️','⛅️','☔️','🍋'];
  22. text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
  23. text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
  24. text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
  25. text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
  26. return text;
  27. }
  28.  
  29. const filter = m => m.author.id === message.author.id
  30. const collector = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" })
  31. const robloxEmbed = new Discord.MessageEmbed()
  32. .setColor("BLUE")
  33. .setTitle("Prompt")
  34. .setDescription("❓ What's your ROBLOX username?")
  35. .setFooter("This prompt will cancel after 200 seconds.")
  36. .setTimestamp()
  37. msg.edit(robloxEmbed)
  38.  
  39. collector.on("collect", m => {
  40. if(m.content === 'cancel' || m.content === 'Cancel') {
  41. message.channel.send('**Cancelled prompt.**')
  42. return
  43. }
  44. rbx.getIdFromUsername(m.content).then(foundId => {
  45. const Id = foundId
  46. const newString = makeid() + makeid() + makeid() + makeid() + makeid()
  47. const foundUsername = new Discord.MessageEmbed()
  48. .setColor("BLUE")
  49. .setTitle("Prompt")
  50. .setDescription("Hello **" + m.content + "**, to verify that you are that user. Please put this in your blurb, or status. \n `" + newString + "`\n\nSay **done** when complete.\nSay **cancel** to cancel. ")
  51. .setFooter("Player ID is " + foundId)
  52. .setTimestamp()
  53. msg.edit(foundUsername)
  54. const collector2 = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" })
  55. collector2.on('collect', async mag => {
  56. if(mag.content.includes('done') && mag.author.id == message.author.id) {
  57. const fetchingBlurb = new Discord.MessageEmbed()
  58. .setColor("BLUE")
  59. .setTitle("Prompt")
  60. .setDescription("Fetching your emojis, please wait as I am going to fetch it.")
  61. .setFooter("Fetching..")
  62. .setTimestamp()
  63. msg.edit(fetchingBlurb)
  64. setTimeout(function() {
  65. rbx.getStatus(foundId).then(status => {
  66. console.log(status)
  67. rbx.getBlurb(foundId).then(blurb => {
  68. if(status.includes(newString) || blurb.includes(newString)) {
  69. const verified = new Discord.MessageEmbed()
  70. .setColor("GREEN")
  71. .setTitle("Prompt")
  72. .setDescription("You have now been verified! Please wait shortly as you are going to recieve the Verified role.")
  73. .setFooter("Verifying..")
  74. .setTimestamp()
  75. msg.edit(verified)
  76. message.member.roles.add(message.guild.roles.find(r => r.name == "Verified"))
  77. message.member.setNickname(m.content)
  78. const idk = Client.db.get(message.author.id)
  79. idk.username = m.content
  80. idk.id = foundId
  81. Client.db.set(message.author.id, idk)
  82.  
  83.  
  84. } else {
  85. message.channel.send("Can not find the emojis.")
  86. }
  87. })
  88. }, 5000)
  89. })
  90. } else
  91. if(mag.content.includes('cancel') && mag.author.id == message.author.id) {
  92. message.channel.send('**Cancelled prompt.**')
  93. return
  94. }
  95. })
  96. })
  97. })
  98. }
  99. exports.conf = {
  100. enabled: true,
  101. guildOnly: false,
  102. aliases: [],
  103. permLevel: "User"
  104. };
  105.  
  106.  
  107. exports.help = {
  108. name: "verify",
  109. category: "Verification",
  110. description: "Verifys Discord user with ROBLOX user.",
  111. usage: "verify <username | id>"
  112. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement