{"id":15893481,"url":"https://github.com/multimeric/discordtypescriptlambda","last_synced_at":"2026-05-06T15:46:00.060Z","repository":{"id":85377218,"uuid":"455088161","full_name":"multimeric/DiscordTypescriptLambda","owner":"multimeric","description":"A template to quickly and easily get your discord bot running on AWS using extremely low-cost Lambda functions","archived":false,"fork":false,"pushed_at":"2023-03-24T10:54:47.000Z","size":336,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T05:23:30.781Z","etag":null,"topics":["aws","aws-lambda","discord","discord-bot","serverless","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multimeric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-03T08:39:35.000Z","updated_at":"2022-02-04T07:33:28.000Z","dependencies_parsed_at":"2023-03-29T19:32:18.443Z","dependency_job_id":null,"html_url":"https://github.com/multimeric/DiscordTypescriptLambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDiscordTypescriptLambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDiscordTypescriptLambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDiscordTypescriptLambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDiscordTypescriptLambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multimeric","download_url":"https://codeload.github.com/multimeric/DiscordTypescriptLambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246863839,"owners_count":20846321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","discord","discord-bot","serverless","typescript"],"created_at":"2024-10-06T08:11:06.278Z","updated_at":"2026-05-06T15:46:00.031Z","avatar_url":"https://github.com/multimeric.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiscordTypescriptLambda\n\nThis is a template repository to quickly and easily get your discord bot running, most likely for free due to the extremely low operation costs of running on AWS Lambda.\n\n## Why Use This?\n\n- AWS Lambda is incredibly cheap to run. Under the [free tier](https://aws.amazon.com/free/), you get 1 million free invocations per month, which corresponds to 1 million bot interactions each month. Even after you exceed this limit, it only costs you $0.20 USD to run another million interactions!\n- Local development is supported by this template, which is the easiest way to rapidly develop your bot on a testing server\n- We use CDK for infrastructure, which is a very powerful and accessible way to edit the stack, especially when compared to raw CloudFormation templates\n- Typescript provides you with incredible type safety, and will help you catch errors early on\n\n## Installation\n\n- Click \"Use this template\" on GitHub\n- Clone the generated repository\n- `cd` into the repository\n- Run `npm install`\n\n## Adding Commands\n\n- For each command you want to add (each `/slash` command), create a new file in `lib/commands`. You may want to copy `hello.ts`.\n- In the constructor, modify the command metadata using the [following options](https://slash-create.js.org/#/docs/main/latest/typedef/SlashCommandOptions).\n- In the `run()` method, implement how to actually handle the command when it is executed\n- **Whenever you add a command, you must register it by first importing it, and then including the class in `lib/common.ts`** (at the bottom).\n\n## Local Development\n\n- It's much easier to test out your bot locally than to test it on AWS Lambda\n- To test, first export the following variables:\n  - `DISCORD_APP_ID`: the \"Application ID\" of your app, listed on the \"General Information\" page of the Discord Developer Dashboard.\n  - `DISCORD_PUBLIC_KEY`: the \"Public Key\" of your app, listed in the same place.\n  - `DISCORD_BOT_TOKEN`: listed on the \"Bot\" page of the dashboard.\n  - `DISCORD_GUILD_ID`: this is the ID of the server in which you are testing the bot. If you enable discord developer mode, you can get this by right-clicking any server and clicking \"Copy ID\".\n- Then run `npm run dev`\n\n## Deploying to Lambda\n\n- Once you are happy with your bot, get ready to deploy to AWS.\n- Export the following variables:\n  - `DISCORD_APP_ID`: the \"Application ID\" of your app, listed on the \"General Information\" page of the Discord Developer Dashboard.\n  - `DISCORD_PUBLIC_KEY`: the \"Public Key\" of your app, listed in the same place.\n  - `AWS_PROFILE`: an AWS profile that has permissions to deploy a CloudFormation stack (e.g. the root account credentials)\n- Run `npm run deploy`\n- Copy the `CdkStack.discordEndpoint` URL printed in the terminal, and paste it into the field labelled \"INTERACTIONS ENDPOINT URL\" on the Discord dashboard\n\n## Adding Additional Infrastructure\n\n- This template is designed to be fully extensible, in case you need to add infrastructure such as a database to your app.\n- To do this open `lib/cdk-stack.ts`\n- For example, to add a DynamoDB (which is easily the cheapest way to add persistent storage), add the following to the bottom of the `cdk-stack.ts`:\n\n```ts\nimport * as dynamodb from \"aws-cdk-lib/aws-dynamodb\";\n\nconst handler: lambda.NodejsFunction;\n\nconst table = new dynamodb.Table(this, \"Table\", {\n  partitionKey: { name: \"id\", type: dynamodb.AttributeType.STRING },\n});\n\ntable.grantFullAccess(handler);\n```\n\n## Setup Actions\n\n- Your bot may need to run certain actions when it is first deployed.\n- For example, if you have added a database you may need to \"seed\" it with initial data.\n- By default the only setup action run in this template is to sync the commands with the Discord API.\n- However if you want to add new actions, simply edit `lib/setup.ts` and add additional AWS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fdiscordtypescriptlambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultimeric%2Fdiscordtypescriptlambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fdiscordtypescriptlambda/lists"}