Discord-Roblox Verify Command Discord.js

Hi everyone! So You Want To Make A Discord-Roblox verification command Well No problem!

THIS POST IS BASED OF:
[NONE OF THE SCRIPTS ARE MINE THEY BELONG TO THEIR RESPECTIVE OWNERS:

This Tutorial Will Go Over Making A Discord Bot from Scratch (Not The actual scratch program :rofl:) With a Verify Command So Lets Get Started!

[EVERYTHING IN TUTORIAL IS BASED ON DISCORD.JS [V12] VERSION]

Setup

Make Sure You Have:

  • Discord Account
  • Roblox Account

There is a lot of things to do before we even Start Scripting,We need to install some applications which will Power Our Discord-Bot:

  • Node.js
    Link: Download | Node.js
    Setup: Download the required Application Version for your pc OS and Run the Setup we are not going to do anything in here for now.

  • CodeEditor
    If you have a Code Editor You Can use it,But If You donโ€™t then You Can Get VScode for Free!
    Link: Download Visual Studio Code - Mac, Linux, Windows
    Setup: Install The required Application Version for your pc OS,Run The Setup And Start The Application.

After Installing These We Can Make Our Own Discord bot Account:

Bot Account

You Need a Discord Account At This Stage if you donโ€™t have one,You Can get it for free!
Link: https://discord.com/new

Now You Need to make a Discord Bot Account.
NOTE: DO NOT SHARE ANY OF YOUR BOT DETAILS.

Head Over To Discord Developer Portal:
Discord Developer Portal
If Asked To Login,then you have to login with your Discord Account
After Going to Discord Developer Portal,Click on New Application


Write A Name for your Application You Can name it anything totally up to you.
Click Create.

NamePage
Click Bot.


You Should See Something like this Click Add Bot

Click: Yes,do it!
AddBotMainPage

You will see this page:

Now Head Over To OAuth2 Page:
Menu

Click on โ€œBotโ€ Then Click On Administrator

Click Copy

Put The Link IN Your Browser And Invite The Bot To Your Server [If You Donโ€™t Have One,Well Make One!]

Installing Discord.js (MAIN FILE)

In This Part We Will Start WIth Scripting Our Bot Any lines Below This Assume You Either Have Done Already Or Completed the Above Parts In This Topic/Thread

  • We will Start With Making A Folder Dedicated Towards this,After This You Have To Open Command Prompt:
    If youโ€™re on Linux, you can quickly open up the terminal with Ctrl + Alt + T .

If youโ€™re on Windows and arenโ€™t familiar with opening up the command prompt, simply do the following:

  1. Open your bot project folder.
  2. Hold down the Shift key and right-click inside of the folder.
  3. Choose the โ€œOpen command window hereโ€ option.
  • With the command prompt open, run the node -v command to make sure youโ€™ve successfully installed Node.js. If you see something like v12.0(Or Higher) , great! If not, go back and try installing again.

  • The next command youโ€™ll be running is npm init . This command creates a package.json file for you, which is what will be used to keep track of the dependencies your bot uses, as well as other info. If youโ€™re a bit confused by that, you can simply ignore it for the time being.

The npm init command will ask you a sequence of questions - you should fill them out as you see fit. If youโ€™re not sure of something or just want to skip it as a whole, simply leave it blank and press enter.

Now we Will Install Discord.js,We will use this for coding:

  • To install discord.js, simply run the npm install discord.js . This can take a bit of time, but should be done fairly quickly.

You should See something link:
image
This is Totally Normal and means you have successfully installed it!

Basic Scripting

Open Your Code Editor here I am using VScode Now You need to press โ€œCTRL + K CTRL + Oโ€ Together (yes)

Find Your Folder and Click Open:

After That You Can Make a new File Its recommended to name it index.js but you can name it whatever you want just make sure it ends with .js

After That Open it by Clicking on it the first thing you want to do is get the Discord.js Module to work so write 1st line as:

const Discord = require("discord.js"); --make sure to add `;`

Now we need to make a client to run commands we do it by adding this line after first line:

const Client = new Discord.Client()

Now lets add prefix add this line after line 1:

var Prefix = "?" //--prefix here

Now we will add another line to know if bot is working or not after line 2:

Client.once("ready",Response => {console.log("Ready!")})

Now Open Terminal (Output) by Clicking (CTRL + `)

Now we can start detecting messages add this line after line 3:

Client.on("message",msg =>
{

})

As we can Detect messages using the function above,
Now we Can start with command.

Here is the code done so far:

const Discord = require("discord.js")
var Prefix = "?" //--prefix here
const Client = new Discord.Client()

Client.once("ready",Response => {console.log("Ready!")})

Client.on("message",msg =>
{

})
Full Scripting

Now lets go ahead to main command

But we need to Install a Module before so Head over to Terminal ( if not open then (CTRL + `) to open)

Type in npm install noblox.js and wait until it finishes after that Change your code to this:

const Discord = require("discord.js");
const noblox = require("noblox.js") //--Added This Before line 2
var Prefix = "?" //--prefix here
const Client = new Discord.Client()

Client.once("ready",Response => {console.log("Ready!")})

Client.on("message",msg =>
{

})

Now we will check if message sent in any channel starts with Prefix and Verify command to do this:
This command will not be case-sensitive

Client.on("message", msg =>
{
    if (msg.content.toLowerCase() == `${Prefix}verify`)
    {
        
    }
})

Now we have noblox we also have discord.js What do we need now?
ANS: Lets start The Main Part Now:

first we will create a async function to Handle everything

const Discord = require("discord.js");
const noblox = require("noblox.js") //Add This Before line 2
var Prefix = "?" //--prefix here
const Client = new Discord.Client()

Client.once("ready",Response => {console.log("Ready!")})

async function Verification(message) //Async Function
{
    
}

Client.on("message", msg =>
{
    if (msg.content.toLowerCase() == `${Prefix}verify`)
    {
       Verification(msg) //Calling Function
    }
})

Now the main part lets by entering info in Verification function:

async function Verification(message)//Async function
{
var EMBED = new Discord.MessageEmbed()
.setDescription("Please Wait While Message Loads")
.setColor('GREEN')
.setFooter("Loading...")
.setTimestamp()

  let msg = await message.channel.send(EMBED) // Send a message for awaiting.
}

Here we are making a message and sending the player to tell that the the function is loading

Now add another function in the same function below that line:

 let msg = await message.channel.send(EMBED) // Send a message for awaiting.
//Continue
function makeid() {
    var text = "";
    var selectFruit = ['๐Ÿ˜€','๐Ÿ˜','๐Ÿ˜‚','๐Ÿคฃ','๐Ÿ˜ƒ','๐Ÿ˜„','๐Ÿ˜…','๐Ÿ˜†','๐Ÿ˜‰','๐Ÿ˜ฒ','๐Ÿ˜','๐Ÿค‘','๐Ÿคฏ','๐Ÿ˜ญ','๐Ÿ˜‘','๐Ÿ˜ถ','๐Ÿ˜‹','๐Ÿ™†','๐Ÿ‘‰','๐Ÿ‘‡','๐Ÿง ','๐Ÿ’ผ','๐Ÿ‘ฎ๐Ÿป','๐Ÿ‘๐Ÿผ','๐Ÿ‘Ž๐Ÿผ','๐Ÿต','๐ŸŒจ','โ˜๏ธ','๐Ÿ’ง','๐ŸŽฌ','๐ŸŽง','๐ŸŽฎ','๐ŸŽฒ','๐Ÿ…','๐Ÿฅ‡','๐Ÿฅˆ','๐Ÿฅ‰','๐Ÿ†','๐Ÿ’','๐ŸŽ','๐Ÿซ','๐Ÿฟ','๐Ÿช','๐Ÿฅ›','๐Ÿฝ','๐Ÿด','๐Ÿ‘','๐Ÿฆ€','๐Ÿ”','๐Ÿญ','๐ŸฆŠ','๐Ÿง','๐Ÿž','๐ŸŒ','๐ŸŒ','๐ŸŒ•','๐ŸŒ–','๐ŸŒš','๐ŸŒ','๐ŸŒต','๐ŸŽ„','๐ŸŒฒ','โ˜€๏ธ','โ›…๏ธ','โ˜”๏ธ','๐Ÿ‹']; //Replace this with "Text " (Do not forget Space)
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];// This will random the emojis 
    return text;
     }
}

Now lets Ask the player for Username

 return text;
  }
//Continue
  const filter = m => m.author.id === message.author.id
  const collector = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" }) //This is the collector to collect the Message for getting the username.
  const robloxEmbed = new Discord.MessageEmbed()
.setColor("BLUE")
.setTitle("Prompt")
.setDescription("โ“ What's your ROBLOX username?")
.setFooter("This prompt will cancel after 200 seconds.")
.setTimestamp()
 msg.channel.send(robloxEmbed) //Send the first Embed
  }

Now the big part i canโ€™t explain this because itโ€™s way to big but what it does is it gets UserId from username and Checks if they have the emoji in status we give them Verified role (Make this role also in your discord and name it exactly Verified)

async function Verification(message)//Async function
{
    var EMBED = new Discord.MessageEmbed()
.setDescription("Please Wait While Message Loads")
.setColor('GREEN')
.setFooter("Loading...")
.setTimestamp()

  let msg = await message.channel.send(EMBED) // Send a message for awaiting.
  
  
  function makeid() {
    var text = "";
    var selectFruit = ['๐Ÿ˜€','๐Ÿ˜','๐Ÿ˜‚','๐Ÿคฃ','๐Ÿ˜ƒ','๐Ÿ˜„','๐Ÿ˜…','๐Ÿ˜†','๐Ÿ˜‰','๐Ÿ˜ฒ','๐Ÿ˜','๐Ÿค‘','๐Ÿคฏ','๐Ÿ˜ญ','๐Ÿ˜‘','๐Ÿ˜ถ','๐Ÿ˜‹','๐Ÿ™†','๐Ÿ‘‰','๐Ÿ‘‡','๐Ÿง ','๐Ÿ’ผ','๐Ÿ‘ฎ๐Ÿป','๐Ÿ‘๐Ÿผ','๐Ÿ‘Ž๐Ÿผ','๐Ÿต','๐ŸŒจ','โ˜๏ธ','๐Ÿ’ง','๐ŸŽฌ','๐ŸŽง','๐ŸŽฎ','๐ŸŽฒ','๐Ÿ…','๐Ÿฅ‡','๐Ÿฅˆ','๐Ÿฅ‰','๐Ÿ†','๐Ÿ’','๐ŸŽ','๐Ÿซ','๐Ÿฟ','๐Ÿช','๐Ÿฅ›','๐Ÿฝ','๐Ÿด','๐Ÿ‘','๐Ÿฆ€','๐Ÿ”','๐Ÿญ','๐ŸฆŠ','๐Ÿง','๐Ÿž','๐ŸŒ','๐ŸŒ','๐ŸŒ•','๐ŸŒ–','๐ŸŒš','๐ŸŒ','๐ŸŒต','๐ŸŽ„','๐ŸŒฒ','โ˜€๏ธ','โ›…๏ธ','โ˜”๏ธ','๐Ÿ‹'];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];// This will random the emojis 
    return text;
  }

  const filter = m => m.author.id === message.author.id
  const collector = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" }) //This is the collector to collect the Message for getting the username.
  const robloxEmbed = new Discord.MessageEmbed()
.setColor("BLUE")
.setTitle("Prompt")
.setDescription("โ“ What's your ROBLOX username?")
.setFooter("This prompt will cancel after 200 seconds.")
.setTimestamp()
 msg.channel.send(robloxEmbed) //Send the first Embed
  
 collector.on("collect", m => {
   if(m.content.toLowerCase() === 'cancel') {
     message.channel.send('**Cancelled prompt.**')
     return
   } //Collector1 End

        noblox.getIdFromUsername(m.content).then(foundId => { //Get the userID from username
            const Id = foundId
            const newString = makeid() + makeid() + makeid() + makeid() + makeid() //Emoji thing
          const foundUsername = new Discord.MessageEmbed()
       .setColor("BLUE")
       .setTitle("Prompt")
       .setDescription("Hello **" + m.content + "**, to verify that you are that user. Please put this in your **Roblox** description, or **Roblox** status. \n `" + newString + "`\n\nSay **done** when complete.\nSay **cancel** to cancel. ")
       .setFooter("This will auto cancel in 200 seconds")
       .setTimestamp()
        msg.channel.send(foundUsername) //The part where it asks you to add the Code
              const collector2 = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" }) // Collector2
       collector2.on('collect', async mag => {
             if(mag.content.toLowerCase().includes('done') & mag.content.toLowerCase().includes("done") && mag.author.id == message.author.id) {
               const fetchingBlurb = new Discord.MessageEmbed()
       .setColor("BLUE")
       .setTitle("Prompt")
       .setDescription("Fetching your emojis, please wait as I am going to fetch it.")
       .setFooter("Fetching..")
       .setTimestamp()
                msg.channel.send(fetchingBlurb) //Checks the Blurb / Status
               setTimeout(function() { //Timeout Stuff
       noblox.getStatus(foundId).then(status => { //Check status
                   console.log(status) //Console.log the status
                 noblox.getBlurb(foundId).then(blurb => { // Checks the blurb
                   if(status.includes(newString) || blurb.includes(newString)) { // If code is in blurb procceds with operation
                     const verified = new Discord.MessageEmbed()
       .setColor("GREEN")
       .setTitle("Prompt")
       .setDescription("You have now been verified! Please wait shortly as you are going to recieve the Verified role.")
       .setFooter("Verifying..")
       .setTimestamp() 
                      msg.channel.send(verified) // Sent if user has put code
                  let Verified = message.guild.roles.cache.find(r => r.name === 'Verified')    message.member.roles.add(verified) // Add the users role
                     message.member.setNickname(m.content) // Sets the users nickname
       
                      } else {
 noblox.getStatus(foundId).then(status => { //Check status
                   console.log(status)
                      var eMbEd = new Discord.MessageEmbed()
                      .setColor('RED')
                      .setTitle("Emoji Not Found")
                      .setDescription(`Your status:${status}`)
                      .setTimestamp()
                      message.channel.send(eMbEd) // Sent if user has not put code
})
                      }
                 })
               }, 5000)
             })
             } else
               if(mag.content.includes('cancel') && mag.author.id == message.author.id) {
                 message.channel.send('**Cancelled prompt.**') // If user says `Cancel`
                                      return
               }
            })
        })

    })
}

Now we need your bot token Just go to discord developer portal click on the app you made click on bot And Under the TOKEN Section click copy then in your code make it:

const Discord = require("discord.js");
const noblox = require("noblox.js") //Add This Before line 2
var Prefix = "?" //--prefix here
const Client = new Discord.Client()

Client.once("ready",Response => {console.log("Ready!")})

async function Verification(message)//Async function
{
    var EMBED = new Discord.MessageEmbed()
.setDescription("Please Wait While Message Loads")
.setColor('GREEN')
.setFooter("Loading...")
.setTimestamp()

  let msg = await message.channel.send(EMBED) // Send a message for awaiting.
  
  
  function makeid() {
    var text = "";
    var selectFruit = ['๐Ÿ˜€','๐Ÿ˜','๐Ÿ˜‚','๐Ÿคฃ','๐Ÿ˜ƒ','๐Ÿ˜„','๐Ÿ˜…','๐Ÿ˜†','๐Ÿ˜‰','๐Ÿ˜ฒ','๐Ÿ˜','๐Ÿค‘','๐Ÿคฏ','๐Ÿ˜ญ','๐Ÿ˜‘','๐Ÿ˜ถ','๐Ÿ˜‹','๐Ÿ™†','๐Ÿ‘‰','๐Ÿ‘‡','๐Ÿง ','๐Ÿ’ผ','๐Ÿ‘ฎ๐Ÿป','๐Ÿ‘๐Ÿผ','๐Ÿ‘Ž๐Ÿผ','๐Ÿต','๐ŸŒจ','โ˜๏ธ','๐Ÿ’ง','๐ŸŽฌ','๐ŸŽง','๐ŸŽฎ','๐ŸŽฒ','๐Ÿ…','๐Ÿฅ‡','๐Ÿฅˆ','๐Ÿฅ‰','๐Ÿ†','๐Ÿ’','๐ŸŽ','๐Ÿซ','๐Ÿฟ','๐Ÿช','๐Ÿฅ›','๐Ÿฝ','๐Ÿด','๐Ÿ‘','๐Ÿฆ€','๐Ÿ”','๐Ÿญ','๐ŸฆŠ','๐Ÿง','๐Ÿž','๐ŸŒ','๐ŸŒ','๐ŸŒ•','๐ŸŒ–','๐ŸŒš','๐ŸŒ','๐ŸŒต','๐ŸŽ„','๐ŸŒฒ','โ˜€๏ธ','โ›…๏ธ','โ˜”๏ธ','๐Ÿ‹'];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];
    text += selectFruit[Math.floor(Math.random() * selectFruit.length)];// This will random the emojis 
    return text;
  }

  const filter = m => m.author.id === message.author.id
  const collector = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" }) //This is the collector to collect the Message for getting the username.
  const robloxEmbed = new Discord.MessageEmbed()
.setColor("BLUE")
.setTitle("Prompt")
.setDescription("โ“ What's your ROBLOX username?")
.setFooter("This prompt will cancel after 200 seconds.")
.setTimestamp()
 msg.channel.send(robloxEmbed) //Send the first Embed
  
 collector.on("collect", m => {
   if(m.content.toLowerCase() === 'cancel') {
     message.channel.send('**Cancelled prompt.**')
     return
   } //Collector1 End

        noblox.getIdFromUsername(m.content).then(foundId => { //Get the userID from username
            const Id = foundId
            const newString = makeid() + makeid() + makeid() + makeid() + makeid() //Emoji thing
          const foundUsername = new Discord.MessageEmbed()
       .setColor("BLUE")
       .setTitle("Prompt")
       .setDescription("Hello **" + m.content + "**, to verify that you are that user. Please put this in your **Roblox** description, or **Roblox** status. \n `" + newString + "`\n\nSay **done** when complete.\nSay **cancel** to cancel. ")
       .setFooter("This will auto cancel in 200 seconds")
       .setTimestamp()
        msg.channel.send(foundUsername) //The part where it asks you to add the Code
              const collector2 = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" }) // Collector2
       collector2.on('collect', async mag => {
             if(mag.content.toLowerCase().includes('done') & mag.content.toLowerCase().includes("done") && mag.author.id == message.author.id) {
               const fetchingBlurb = new Discord.MessageEmbed()
       .setColor("BLUE")
       .setTitle("Prompt")
       .setDescription("Fetching your emojis, please wait as I am going to fetch it.")
       .setFooter("Fetching..")
       .setTimestamp()
                msg.channel.send(fetchingBlurb) //Checks the Blurb / Status
               setTimeout(function() { //Timeout Stuff
       noblox.getStatus(foundId).then(status => { //Check status
                   console.log(status) //Console.log the status
                 noblox.getBlurb(foundId).then(blurb => { // Checks the blurb
                   if(status.includes(newString) || blurb.includes(newString)) { // If code is in blurb procceds with operation
                     const verified = new Discord.MessageEmbed()
       .setColor("GREEN")
       .setTitle("Prompt")
       .setDescription("You have now been verified! Please wait shortly as you are going to recieve the Verified role.")
       .setFooter("Verifying..")
       .setTimestamp() 
                      msg.channel.send(verified) // Sent if user has put code
let Verified = message.guild.roles.cache.find(r => r.name === 'Verified')   
message.member.roles.add(Verified) // Add the users role
                     message.member.setNickname(m.content) // Sets the users nickname
       
                      } else {
 noblox.getStatus(foundId).then(status => { //Check status
                   console.log(status)
                      var eMbEd = new Discord.MessageEmbed()
                      .setColor('RED')
                      .setTitle("Emoji Not Found")
                      .setDescription(`Your status:${status}`)
                      .setTimestamp()
                      message.channel.send(eMbEd) // Sent if user has not put code
})
                      }
                 })
               }, 5000)
             })
             } else
               if(mag.content.includes('cancel') && mag.author.id == message.author.id) {
                 message.channel.send('**Cancelled prompt.**') // If user says `Cancel`
                                      return
               }
            })
        })

    })
}

Client.on("message", msg =>
{
    if (msg.content.toLowerCase() == `${Prefix}verify`)
    {
        Verification(msg) //Calling Function
    }
})

Client.login("TOKEN HERE") //Insert your token here make sure it is in `" "`

Now in Terminal (CTRL + `) type node [file name]
for me it is:

node index.js

More Help

So you need more help or maybe you didnโ€™t understand my grammar There are more posts on DevForum like these so you can read them as well:
[TUTORIAL] How to make a Verification Command! [NODE.JS]

After this you can save file using CTRL + S or Using File button [MAKE SURE TO SAVE OR IT WONโ€™T WORK]
If You have any info My Twitter is @Megatank9 you can tag me there this is my 1st tutorial hope you enjoyed!

THIS MAY OR MAY NOT BE UPDATED IN FUTURE.

15 Likes

I had already thought of a system like the one that uses the roblox API for get player description but I never do it because I was lazy. Great tutorial!

1 Like

Thank you hope you enjoyed the tutorial this really take ton of time!

1 Like

I have question, for verify the account the bot just give you emoji or text?

1 Like

In This tutorial it gives you emoji you can easily change it by replacing it with Text but text usually has risk of getting tagged

2 Likes

it was precisely for the tags that I asked x ')

I donโ€™t like roblox filtering system is so bad it blocks all numbers

1 Like

This is true but i think emoji donโ€™t really make problem?

I think not, but it can be blocked for example, we can block obergine and clemantine

1 Like

It has very simple emoji so no worries on that

Hello, there seems to be an error on line 109.

Verification(msg).then().catch(err)//Calling Function

The catch method accepts a function, but it seems like you did not put a function I would recommend fixing this.

1 Like

Oh didnโ€™t saw that Thanks for putting it out to me!

1 Like

Itโ€™d be nice if you explained people how to use a database to actually store that information, so that people wouldnโ€™t have to verify each time. Nice tutorial though!

1 Like

I am working on tutorial for that :smile:

There is a very similar tutorial that I have just stumbled upon, the code (for the most part) is quite similar.

2 Likes

Code is way too similar, reported OP for plagiarism.

3 Likes

I did saw that if i would have saw it,i wouldnโ€™t have made this tutorial thanks for telling i am definitely gonna link this in my tutorial and it is just a revision of that post

I highly doubt you didnโ€™t know that existed because both codes have the exact same style, formatting, and commentsโ€ฆ

1 Like

It was โ€œNotโ€ Copied I just wanted to revise it because Not many people have seen it and It doesnโ€™t appears in Search usually I am definitely going to mention his tag his post name and everything

If needed this post can be taken down on request of author or others.

So I attempted to fix your Code, and it works.
Added some extra stuff in it.

var discord = require('discord.js')
var noblox = require('noblox.js')
var prefix = ">" //Replace it to what ever you want.
const client = new discord.Client()

client.on("ready", ready => {
    console.log("Bots ready.")
})


function isCommand(command, message){
    var command = command.toLowerCase();
    var content = message.content.toLowerCase();
    return content.startsWith(prefix + command);
}
 
client.on('message', (message) => {
    if (message.author.bot) return
    //Functions to make it easy
    function SendVerificationMessage(Title,Description,Color){
        const Embed = new discord.MessageEmbed()
        .setAuthor("Verification System")
        .setTitle(Title)
        .setDescription(Description)
        .setColor(Color)
        .setFooter("Verification System")
        .setTimestamp()
        message.channel.send(Embed)
    }
    if(isCommand('ping', message)){
        const start = Date.now()
        message.channel.send(':ping_pong: **Getting The Ping...**').then(msg => {
            msg.edit(`:ping_pong: **Ping: ${Math.ceil(Date.now() - start)}**`)
        })
    }
    var cool = function(){
        console.log("Cooldown chill")
    }
    if(isCommand('verify', message)){
        message.channel.send("**Starting the verification...**").then(editedMsg => {
            setTimeout(cool, 10000)
            editedMsg.edit("**Getting your prompt...**")
            setTimeout(cool, 10000)
            editedMsg.delete()
            function MakeRandomStuff(){
                var text = ""
                var RandomStuff = ['roblox forms are gone','math is good']
                text += RandomStuff[Math.floor(Math.random() * RandomStuff.length)]
                return text;
            }  
            const filter = m => m.author.id === message.author.id
            const collector = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" })
            SendVerificationMessage("Username?","Whats your Roblox Username?","BLUE")
            collector.on('collect', m => {
                if(m.content.toLowerCase() === "cancel"){
                    SendVerificationMessage("Prompt","Cancelled The Verification prompt.",'RED')
                }
                noblox.getIdFromUsername(m.content).then(foundUser => {
                    const UserId = foundUser
                    const String = MakeRandomStuff()
                    SendVerificationMessage("Hello, " + m.content + "!","To Verify thats you please put this in your Roblox Status or Bio\n`" + String + "`\nWhen your done say `done`\nIf you wish to Cancel the prompt say `cancel`.",'GREEN')
                    const collector2 = message.channel.createMessageCollector(filter, { max: '1', maxMatches: "1", time: "200000" })
                    collector2.on('collect', async mag => {
                        if(mag.content.toLowerCase().includes('done') & mag.content.toLowerCase().includes("done") && mag.author.id == message.author.id){
                            message.channel.send("**Serching for " + String + ", On " + m.content + "**").then(msg => {
                                setTimeout(function(){
                                    noblox.getStatus(UserId).then(status => {
                                        noblox.getBlurb(UserId).then(blurb => {
                                            if(status.includes(String) || blurb.includes(String)){
                                                msg.edit("**You are now verified as `" + m.content + "`!**\nPlease wait for your roles.")
                                                var verifyRole = message.guild.roles.cache.find(role => role.name === "Verified")
                                                message.member.roles.add(verifyRole)
                                                message.member.setNickname(m.content)
                                                msg.delete()
                                            } else {
                                                noblox.getStatus(UserId).then(status => {
                                                    msg.edit("**Please check your Roblox Status or Blurb again.\nYour Status: " + status)
                                                })
                                            }
                                        }, 5000)
                                    })
                                })
                            })
                        } else {
                            if(mag.content.includes('cancel') && mag.author.id == message.author.id){
                                message.channel.send("**Cancelled Prompt!**")
                            }
                        }
                    })
                })
            })
        })
    }
})

client.login("Your discord bot token")

Tell Me if this works.

Can you tell me what error does this code has so i can fix it just in case