Built to run perpetualy on AWS as an ECS container utilizing t2.micro EC2 instance. These instances are available on AWS's Free Tier and therefore can be run extremely cheaply, if not for free. ECS is always free to use as you only pay for the underlying EC2 instance usage.
Has a clear separation of concerns between the bot and the commands it can run. This allows for easy extensibility and maintainability.
Has 100% test coverage so you can trust that this bot works exactly as intended, and start adding new tests for new commands from a clean slate.
Written in typescript and runs as a daemon process using ts-node
.
npm i
npm run start
Bot will run inside of terminal until killed as it's essentially a DAEMON process.
npm run lint # fixes any issues it can fix automatically
- Go to the Discord Developer Portal
- Create a new application
- Go to the Bot tab and create a new bot
- Copy the token
- Go to your Discord server
- Right click on the server name in the left sidebar
- Click on "Copy ID"
- Go to the Discord Developer Portal
- Click on the application you created earlier
- Go to the OAuth2 tab
- Copy the Client ID
- Install AWS CLI and configure your AWS credentials.
- Install AWS CDK:
npm install -g aws-cdk
- Bootstrap your AWS environment:
cdk bootstrap
- Deploy the stack:
npm run cdk:deploy
Note: Ensure you have set up the necessary environment variables (CLIENT_ID
, GUILD_ID
, and BOT_TOKEN
) in your AWS account or directly in the CDK stack (see cdk/discord-bot-stack.ts
).
- Go to the Discord Developer Portal
- Click on the application you created earlier
- Go to the OAuth2 tab
- In the "OAuth2 URL Generator" section, select the "bot" scope
- Copy the generated URL and paste it into your browser
- Select the server you want to invite the bot to
- Click "Authorize"