Note
New 2024 Source Code:
The updated Next.js source code (March 2024) is available for download here.
For self-hosting instructions (cheaper/safer!) by @million1156
, see this guide.
For a better alternative with 10X the features, try VaultCord, owned by the trusted team at KeyAuth.cc (170K+ users).
This is the source code of my Discord data recovery project during the timeframe April 2020 - January 2022. Code still functions as expected.
Split in 2 languages, PHP & C# - if you prefer a unified code project written in Next.js (Javascript), see the 2024 source code above.
The source code can be used for commercial use if you would like. No attribution needed, though if you insist; it would be appreciated if you credited VaultCord.com ❤️
However, I do not permit use of the distinct name "RestoreCord" or the logo graphic. These aren't avaliable in this repository.
- Multi server
- Restore members
- IP logging
- Discord webhook notifications
- Handles rate limits and access token refreshing. Most bots don't and break when you try to pull members, not this.
- VPN detection/block
- IP blacklist
PHP and MySQL. Should work on most PHP versions. I tested on PHP 7.4 and PHP 8.0, worked on both. You must have a VPS. Shared hosting such as NameCheap will not work, as you have to run c# application also
Please setup your MySQL database now and import the structure from here https://github.com/wnelson03/RestoreCord-Source-Code/blob/main/restorecord_db_schema.sql
- Change the
restorecord.com
at toexample.com
(where example.com) is your website's domain - Replace
botTokenHere
with your Discord bot token - (optional - only needed if you do NOT use cloudflare) change
HTTP_CF_CONNECTING_IP
toREMOTE_ADDR
(do NOT do this if you're using cloudflare) at , , , , and - (optional - only needed if you have more than 1,000 people verify a day) change
proxyCheckKeyHere
to a proxycheck API key if you have so many users you need to pay at - Change OAuth2 authorization link at you get your authorization link from Discord developer portal, like this https://imgur.com/a/G3q4oDM
- Change captcha keys here and or remove the captcha. I don't recommend removing captcha if you plan to sell this. Captcha is very neccesary for public websites. But if it's not a commercial site, you should remove lines 100-109 and then register will work
- Set MySQL connection info at
- If you have other users than yourself owning servers on this source and you want to log their actions, replace
discordWebhookHere
with your webhook url on , , , and - If you plan to sell this source, replace
8hCOmd6
with your Shoppy.GG product ID and then on Shoppy.GG, set these settings for the product https://imgur.com/a/XkRC3Pe and then make sure you set your Shoppy.GG webhook secret at - Replace
DiscordBotClientID
with your Discord bot's application ID - Replace
DiscordBotClientSecret
with your Discord bot's client secret - Replace
https://restorecord.com/auth/
withhttps://example.com/auth/
and use your website's domain instead ofexample.com
- Replace
https://restorecord.com/verify/
withhttps://example.com/verify/
and use your website's domain instead ofexample.com
Now for c# part
- Change
https://restorecord.com/auth/
tohttps://example.com/verify/
and use your website's domain instead ofexample.com
- (important, you don't want Discord to think you're a bot RestoreCord owns and ban you) Change
RestoreCord (public release, 1.0.0.0)
to the name of your site or something - Replace
rest_admin
with database username, replacerest_main
with database name - Replace
databasePasswordHere
with database password - Replace
clientSecretHere
your Discord bot's client secret - Replace
discordIdHere
with your Discord bot's application ID - Replace
botTokenHere
with your Discord bot's token
Written for Debian 11
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-5.0 dotnet-runtime-5.0
For this next part make sure you are in the bot's root directory.
dotnet restore
dotnet build
You now have an executable!
Create a service using systemctl, make sure to replace the paths.
[Unit]
Description=Restorecord
After=multi-user.target
[Service]
WorkingDirectory=/path/to/working/directory
ExecStart=/path/to/bot/executable
SyslogIdentifier=Restorecord
Type=idle
Restart=always
RestartSec=15
RestartPreventExitStatus=0
[Install]
WantedBy=multi-user.target
Once you set this up, the bot should come online and slash commands should work, do /
and you'll see slash commands
Here's a YouTube video showing how to use the bot https://nelsoncybersecurity.com/restorecord-tutorial.mp4
How to give yourself lifetime premium (replace yourUsernameHere
with your username):
UPDATE `users` SET `role` = 'premium',`expiry` = 2224663363 WHERE `username` = 'yourUsernameHere'