https://github.com/gemisis/captain-chris-bot
A bot for CNU based chat servers. Currently focused around Discord.
https://github.com/gemisis/captain-chris-bot
aws aws-cdk aws-lambda cdk cnu discord discord-bot discordbot typescript
Last synced: about 1 month ago
JSON representation
A bot for CNU based chat servers. Currently focused around Discord.
- Host: GitHub
- URL: https://github.com/gemisis/captain-chris-bot
- Owner: GEMISIS
- License: mit
- Created: 2023-01-04T05:55:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T04:31:36.000Z (over 2 years ago)
- Last Synced: 2025-01-22T14:31:48.589Z (over 1 year ago)
- Topics: aws, aws-cdk, aws-lambda, cdk, cnu, discord, discord-bot, discordbot, typescript
- Language: TypeScript
- Homepage:
- Size: 146 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.MD
Awesome Lists containing this project
README
# Captain Chris Bot
This is a Discord bot for Christopher Newport University servers! It makes use of AWS to allow for the bot to be serverless, meaning there is no dedicated host waiting for commands. Instead, it uses the [Discord Bot CDK Construct](https://constructs.dev/packages/discord-bot-cdk-construct/) in TypeScript to deploy via API Gateway and Lambda functions.
Interested in adding it to your Discord server? Contact me [here](https://geraldmcalister.com/contact.html) (use any Subject you want) to request a link to it. The bot will be made more public at a later date.
## Getting Started Contributing
To get started developing the bot, checkout the wiki page for the bot at [https://github.com/GEMISIS/captain-chris-bot/wiki](https://github.com/GEMISIS/captain-chris-bot/wiki).
## Architecture
The architecture of this projet is fairly simple: When a user uses a slash command from this bot, Discord will reach out to our endpoint at API Gateway and call into the lambda function at [src/functions/core-command.ts](src/functions/core-command.ts). If the command is valid, then the corresponding command in [src/commands](src/commands) will be called! You can see the architecture of the cloud side below:

## Useful commands
### For testing, use the following commands
- `npm run test` perform the jest unit tests and output coverage
- `npm run command ` runs a desired command locally.
- `` should be in the format of a `IDiscordRequestData` object, for example: `'{"name": "hello"}'`.
### For deplying, use the following commands
- `npm run build` compile typescript to js
- `cdk synth` emits the synthesized CloudFormation template
- `cdk deploy` deploy this stack to your default AWS account/region
### For keeping the code clean, use the following commands
- `npm run lint` runs linting across the code
- `npm run fix-lint` fixes any lint issues where possible across the code
- `cdk diff` compare deployed stack with current state
### Run the following to manage slash commands
- `npm run configure ` sets up the slash commands using the secret keys in CDK.
- `npm run reset ` resets the slash commands using the secret keys in CDK.