We created this bot for our own personal SCUM server and never intended to open source it. It was created in a way to just work for our setup with little regard for good principles and efficiency. Please keep this in mind when using it and make your own adjustments as needed.
There are 3 parts to this project
Features
- Kill feed
- Chat feed
- Bounties
- Discord Shop with automatic item delivery
- Reward coins for playtime
- Raffle
- Events
- Full admin command set
- Lightly started squad tracking
- Announcing automatic restarts
You will need node 16.x and a MySQL instance set up.
Restore dump.sql
for table schema
The admin locked commands require a Discord role named "Admin" to use.
Install node packages.
npm install
Edit the config.json file with with necessary options. You will need to set up a Discord BOT to get the botToken. All the channel IDs can be fetched by using Developer mode on the Discord app.
Run the bot (should setup a service for prod -- read below)
node discord_bot.js
Create a new systemd /etc/systemd/system
[Unit]
Description=Scumtopia Discord Bot
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/servers/scumbot/scum_discord_bot -- CHANGE ME
ExecStart=/usr/bin/node discord_bot.js -- CHANGE ME
Restart=on-failure
[Install]
WantedBy=multi-user.target
cd
into the directorygit pull origin
to grab the latest codeservice scumbot restart
restart the service to pickup new code changes
If you'd like the bot to warn players 15 minutes before automatc restarts you will need to create a schedule in MySQL - https://www.mysqltutorial.org/mysql-triggers/working-mysql-scheduled-event/
We've kept examples of how to create an event in the database dump. Adjust them as needed.
Create events that occur x minutes before each scheduled restart time with the below action. The game bot will pick these up and execute the #Announce
command.
INSERT INTO announcements (content) VALUES ('The server will restart at 6PM AEST (about 15 minutes)')
Admin Commands
!check <Discord|SteamID> <all|orders>(optional)
- check user details
!coins <DiscordUser> <+100|-100|200>
- adjust user coins by adding, removing or hard set (no +/-)
!shop <category>
- repopulate the shop items. run in the shop category channels to update the shop
!raffle <open|close|pick>
- open, close or pick a winner for the raffle
!redeliver <OrderID>
- redeliver an order for whatever reason
Anyone commands
!balance
lets users check their coin balance
!entries <amount>
- enter in to the raffle x times
!gamble <black|red>
- wasn't really used or finalised, but let players gamble 100 coins for a chance to double their money
!help
- displays the command info
!pay <DiscordUser> <Amount>
- allows players to transfer funds to each other
!register <SteamID64>
- required for players to begin using the bot. registers their discord id in the database
!status
- checks if the bot is online and pings admins if not
!support
- shows info on how to submit a support ticket (probably change this for your use)
!bounty <@DiscordUsername> <NumberOfCoins>
- place a bounty on the user for a set amount of coins
This bot is not to be used in a commercial scenario or for a profit driven server. This was released for other SCUM server owners to setup and use for free without being preasured in to paying for it by other SCUM bots. We would appreciate you crediting us (the authors) although not required.
Feel free to open a pull request if you think there are changes that should be made. I'll review them eventually.
Credits to myself and Daniel as well as the SCUMTOPIA community for their support and testing.