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: SkayVerifierVersion: 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 Index of /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
- 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 fromCreating bot token
sectioncommand
default value"!v"
- you can customize your command, which users have to typelang
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 directlychannel_id
default value""
(empty) - channel for users to type command*code_length
default value8
- length of generated code, I suggest to leave that option on defaultdb
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 DOINGFirst 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.Discord obtaining code
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.