https://github.com/davealdon/aws-lambda-discord-bot
https://github.com/davealdon/aws-lambda-discord-bot
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/davealdon/aws-lambda-discord-bot
- Owner: DaveAldon
- Created: 2022-09-21T19:25:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-10T19:32:45.000Z (over 3 years ago)
- Last Synced: 2025-03-29T04:07:04.689Z (about 1 year ago)
- Language: TypeScript
- Size: 860 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Useful commands
- `node register_commands/register.js` register slash commands with Discord - if Guild ID isn't present in .env, these will be deployed globally
- `sam build && sam deploy --guided` deploys the bot to AWS Lambda
- `node generate_template/generate.js` generates a CloudFormation template for the bot
- `node generate_template/generate.js && \ node register_commands/register.js && \ sam build && sam deploy` deploys the bot after you add new commands to `src/modules/example/`
`sam destroy` cleans up
# Troubleshooting
Can't deploy?
```
aws configure list
nano ~/.aws/credentials
```
Make sure there is a mfa profile in the credentials file. If not, add one that looks like this:
```
[mfa]
aws_access_key_id =
aws_secret_access_key =
aws_session_token =
```
Then run the mfa script:
```
sh mfa.sh
```
# Notes
This project contains source code and supporting files for a serverless application that you can deploy with the AWS Serverless Application Model (AWS SAM) command line interface (CLI). It includes the following files and folders:
- `src` - Code for the application's Lambda function.
- `events` - Invocation events that you can use to invoke the function.
- `__tests__` - Unit tests for the application code.
- `template.yaml` - A template that defines the application's AWS resources.
Resources for this project are defined in the `template.yaml` file in this project. The file has its own template generator. You can update the template to add AWS resources through the same deployment process that updates your application code.