/RestoreCord-Source-Code

Open Source code for Discord bot RestoreCord.com, the website VaultCord.com is much better!

Primary LanguageCSSCreative Commons Zero v1.0 UniversalCC0-1.0

RestoreCord Source Code

Note

New 2024 source code: The updated Next.js source code from March, 2024 can be downloaded here (click)
Instructions for self-hosting are available here (click)

Warning

I strongly recommend not using restorecord.com:

After my stint of ownership in RestoreCord, the new owners do not reflect the values of privacy and safety.
The new ownership recently sold personal data revealed in a data breach also covered in global news with millions of views.

I recommend using VaultCord with 4X more features and also owned by the staff of KeyAuth.cc (very well-known service with 110K+ users). Far more trusthworthy than the "xenos1337" person of Restorecord confirmed to be scamming.

Tutorial video how to host for 100% free forever: https://www.youtube.com/watch?v=804Fzc5j4vo

This is an old software project of mine spanning from April 2020 - January 2022. The code still works for current Discord API and functions as expected.

Written in PHP & C# - if you prefer a unified code project written in Next.js (Javascript), see the 2024 source code above.

Copyright License

The 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 ❤️

NOTE: nobody aside from myself (William Nelson) has legal rights to use my logo for RestoreCord this one (not the new restorecord.com logo), or repost videos I've recorded for RestoreCord. If you do not follow this, you will recieve a copyright takedown.

Don't worry the logo isn't included in the source code, you would have to go out of your way to download the logo on another website, so you won't get a copyright takedown on accident 👍

Features

  • 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

How to setup

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

Now for c# part

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'