SkayVerifier - automatic user verifier for your server Discord => FiveM

SkayVerifier

Hey! Last time I was creating Discord based script for job managment (this includes making cash by executing commands, trading and so on), but suddenly support for Discord Identifiers was removed. Also I noticed Discord ids works not every time (due to rate limit I think) .I decided to create simple Discord -> FiveM bridge, so players has to verify themself via code passed by Discord bot. This also could replace scripts like *enter password from discord*, where password is static or changing sometimes. Bot generates random code and is highly customisable. However you have to create your bot, if you want bot hosted by me, you could vote in poll above. To install you'll need vps with node.

Because you need to create bot, I’ve decided to make tutorial for you in case you don’t know how to. I made this bot super duper noob friendly so everyone could easly create own.


Basic info

Name: SkayVerifier

Version: 1.0 (initial)

Download: bottom of this post

Dependencies: mysql-async

Support: this thread, if interest will be bigger, I could also create separate discord server, but for now I don’t want to.

Changelog
  • + 1.0 initial

Node (required to run Discord bot)

Windows based vps node installation
  • Download official instaler from http://nodejs.org/download/
  • Install software (license, next next, blah, default options are fine)
  • Restart PC
  • If you are done, run command prompt (cmd in start menu) and type node -v to check if node was successfully installed
  • Done, wasn’t it easy?
Linux based vps node installation

Because linux by default is installing pretty old package you have to update manually

  • wget -qO- https://deb.nodesource.com/setup_13.x | sudo -E bash -
  • Enter command above in terminal to automatically run setup
  • sudo apt-get install -y nodejs
  • This command will install updated node to your linux server
  • Check installation by node -v command
  • Restart PC… Just kidding :smiley:
  • Done, wasn’t it easy?

Okay, so if you are done with node installation create directory for bot files, next step is installing script dependencies, you can do that by Node Package Manager, if you’re on Windows open cmd, if on linux just stay on terminal, run these commands

  • npm install -g discord.js
  • npm install -g mysql

Steps above will install node modules globally. Cool! We’ve done with node!


Creating bot token and inviting

Do you want discord bot, huh? You need to register them. Go to https://discord.com/developers log in and click on `New application`, enter your's apps name (you could name it SkayVerifier or just Verifier or anything you want) and now click on bot tab at left. Click on `Add bot`, then `Yes do it` aaaand we're done! Cool! Copy token and save it for later. Now you can invite them by clicking `OAuth2` tab on left, selecting `bot` checkbox in `SCOPES` section and `Administrator` in `BOT PERMISSIONS` section then copy link and paste to your browser.

Bot configuration

Okay, now we can move on to configuration our bot. Download bot files from download section and drop them to previously created directory. Open config.json, JSON files can't be commented, so I'm going to explain everyting here.
  • name default value "" (empty) - you can change bots name (be aware of rate limit of this option, if you’re fine with previously given name just leave it as is)
  • token default value "" (empty) - this field is required, you have to put here your token from Creating bot token section
  • command default value "!v" - you can customize your command, which users have to type
  • lang default value "en" - for easy setup there’s not need to changing messages in main.js file, just go to lang directory, copy en.json file and change name to your liking, or edit en.json file directly
  • channel_id default value "" (empty) - channel for users to type command*
  • code_length default value 8 - length of generated code, I suggest to leave that option on default
  • db is a section where you must fill in your database credentials

*I highly suggest to set cooldown on that channel.
ALL VALUES IN en.json FILE SURROUNDED BY # ARE DYNAMIC, YOU COULD MOVE/DELETE THEM AS YOUR WILL

Done? Cool! Now you can run your bot by node main.js command in your terminal/cmd.


Script configuration

DO NOT CHANGE SCRIPT NAME UNLESS YOU KNOW WHAT ARE YOU DOING First config file is in main directory named `config.lua`. Table name is name which you've previously configured in node part. Another options are well commented.

Next (and last) config file is lang file inside html directory. Here you can use icons from https://fontawesome.com/ as I have done.


Preview

Every screenshot has been made on default settings.
FiveM verification screen

Discord obtaining code

image
image


Download

FiveM part:

skayverifier.rar (9.0 KB)
!WARNING! I forget to change one line, so if you change table name to different as default, you need replace word SkayVerifier line 78 in server.lua to ' .. config.tableName .. '
I’ll repair this in next update!
Discord part:
SkayVerifier-Discord.rar (6.4 KB)

I tried to make everything understandable, english is not my native so I could made major grammar mistakes, sorry. If your english is better and you want to improve/correct this topic DM me.
You can edit/fork files directly, however you’re not allowed to delete/modify/hide copyright div from html file, hope you’ll understand.


24 Likes

nice and ez :smirk:

Welldone!!

Not a bad idea, however, why not utilize adaptive cards with deferrals so they have to put it in before they even connect? It’s not that hard to bypass this; all you’d need to do is delete the element in the CEF devtools, and toggle NUI focus to that resource.

1 Like

You’re still not able to walk nor even see, because of played scene, but you’re right, more server-side blocks would be needed. I’m gonna update script soon, so appreciate your opinion :smile:

1 Like

1 Like

I’m sorry you need to execute npm install -g discord.js (note dot between discord and js) :slight_smile:

1 Like

same problem here :stuck_out_tongue:

Does anyone wanna guide me how to create a .bat/start file for the bot instead of doing the command everytime. Know you can do it, I am just stupid.

@echo off
node main.js
pause

Destination?

Your’s script folder, or if you want run bot from desktop do

@echo off
cd C:\your\path\to\folder\with\script
node main.js
pause
1 Like

Thanks

Any ideas? ;/

creat video how to install it haha

2 Likes

So I wrote this without the -g, only then it installed. Is that a problem?

Well that means you have installed discord.js to your local directory which was currently selected, as long as you will not move any files you’re good


This is my new problem :confused:

Good release in case the Discord Identifier does stop working, for now the current method that was implemented with Discords input works well also.

Where can i find the SQL table? does it imports automatically or i need to import it to my Database?