ApplicationBot is a Discord bot for guilds and other online communities to manage applications.
I recommend hosting the bot on a free-tier EC2 instance.
- Set up application in the Discord Developer Portal.
- Add a bot user to the application. Copy the token. Don't share or commit it. Adjust .gitignore if needed.
- Invite bot to server. Recommended permissions
- Download files and test the bot locally.
npm install
tsc
node dist/src/index.js
- Launch instance and save the key pair provided.
- Convert .ppk to .pem with PuTTYgen.
- Connect to EC2 server with WinSCP (or any FTP client).
- Upload files.
- Install node & package dependencies.
$ sudo apt-get update
$ sudo apt-get install nodejs
$ sudo apt-get install npm
$ npm install
-
Install forever module
$ sudo npm install forever -g
. I highly suggest reading the logging options and also specifying logging files. -
Run application
$ forever start index.js
- Never have more than one running instance (especially for a long period of time)
- Set up billing notifications
- Free instances last 1 year before they are not free (on that account)
To customize the bot for your community, a few edits will be needed.
-
Create your appSettings. Start by copying the appSettings to a new file. Customize the data accordingly. I usually set up appSettings.dev.json and appSettings.prod.json (one with keys for a dev Discord server, another with the "main" server).
-
Create the channels and roles as described in appSettings. Currently, channel flexibility is limited.
-
In index.ts, point the app to the appSettings you wish to use. e.g.
import * as appSettings from '../appSettings.prod.json';
Recompile tsc
.
/apply
(in apply channel)
/archiveapp
(in application-NAME channel)
Moves app conversation to archive.
/test
(to bot in DMs)
Will respond 'Bot running.' if running.
/restore
(to bot in DMs)
Will manually restore and move an application if votes do not go through due to bot downtime.
/restore "Member Name [Application Acceptance Status Here]" application-xxxxxxxxxxxxxxxxxx-1-1-2021.json
Application backups are saved automatically to /backups. File may need to be moved before it can be successfully restored (or adjust path accordingly).