Scradd is a custom all-in-one Discord bot for the Scratch Addons (SA) server. It has many features, such as punishments, auto moderation, “potatoboard”, XP, and much more. It also has many features specific to Scratch Addons, including addon search, suggestion utilities, fun games, tons of inside jokes, and more.
Most of Scradd is programmed by @RedGuy12 (cobaltt7 on Discord). Please run /credits for more information -- thanks
to everyone listed on there!
Pull requests are welcome if you would like to help contribute. Please read through the Contributing Guidelines if you are interested in helping out.
- Visit the Discord Developer Portal and create a new application.
- Note the “Application ID” for future use.
- Go to the “Bot” tab and add a bot to the app.
- Highly recommended: Disable the “Public Bot” switch so random people don’t add it to their servers.
- Make sure to toggle all three of the Privileged Gateway Intents (the Presence, Server Members, and Message Content Intents) on.
- Click “Reset Token” and note it for future use.
- Create a new server using the Scradd Testing server template.
- Enable Community in Server Settings. Use
#infofor the Rules or Guidelines channel and#mod-logsfor the Community Updates Channel. - Enable Developer Mode under User Settings → Advanced.
- Right-click on your new testing server, copy its ID, and note it for future use.
- Invite your bot at
https://discord.com/oauth2/authorize?client_id=[APPLICATION_ID_HERE]&guild_id=[SERVER_ID_HERE]&permissions=8&scope=applications.commands%20bot
- Make a MongoDB account if you don't already have one.
- When asked to deploy a cluster, select a free M0 cluster and name it Scradd. All other default settings are fine.
- Choose to authenticate with a username and password. What you set them to doesn't matter. Note the password for future use.
- Choose connecting from your local environment and add your current IP address to the list. If you expect to develop
from many locations, you can alternatively add
0.0.0.0/0to allow any IPs to connect. - Once the cluster is created, select “Get connection string” under “Application Development”. Copy the connection
string from the modal (probably under step 3), replace
<password>with your password, and note it for future use.
- Download git and Node.js if you haven’t already.
- Clone the repository using the
git clonecommand. - Install dependencies with
npm install. - Set up the .env file as described in
global.d.ts. - Code!
This bot is built using strife.js and follows its recommended style guide and
structure. In addition, the common directory contains code used across multiple features, and the util directory
contains utility functions used across the codebase. util is different from common as its functions are not specific
to this bot but could be useful in other apps as well.
Scradd has a couple of dev commands to streamline your coding.
npm run build: One-time build with TypeScriptnpm run start: Run the botnpm run dev: Rebuild with TypeScript on each code changenpm run serve: Run the bot and restart with nodemon on each successful buildnpm run format: Format code with Prettiernpm run lint: Lint code with ESLintnpm run test: Run unit tests with the Node.js native test runner