Discord bot that traverses through the Riot Games API to find information about players of the game League of Legends.
Zoe is an IaC monorepo application that utilizes SST and Discord. Make sure to have the following installed and configured.
Create a new Application
Enable Privileged Gateway Intents under Bot
Invite to server with https://discord.com/oauth2/authorize?client_id=<client_id>&permissions=536870912&scope=applications.commands%20bot
Note: Replace
After deploying the bot to AWS using either npm run deploy
or npm run deploy:prod
, paste InteractionsEndpoint into Interactions Endpoint URL under General Information
Set environment configuration config.json
{
"aws_region": "<AWS REGION>",
"riot_key": "<RIOT API KEY>",
"discord_public_key": "<DISCORD PUBLIC KEY>",
"application_id": "<DISCORD APPLICATION ID>",
"token": "<DISCORD BOT TOKEN>"
}
The bot is configured to be able to deploy to multiple stages. This changes configurations in the AWS stack.
npm run deploy
- deploy dev stack, returns InteractionsEndpointnpm run deploy:prod
- deploy prod stack, returns InteractionsEndpoint, URLIn the Discord Application on Discord Developer Portal under OAuth2, create a redirect URL using URL/load
The redirect URL will look like this https://abcdefghijklm.cloudfront.net/load
Under Authorization Method, choose In-app Authorization
Enable Scopes: bot, application.commands
Enable Bot Permissions: Manage Webhooks
Instructions to deploy SST apps using GitHub Actions can be found here
{
"pat": "<GITHUB TOKEN>",
"owner": "<GITHUB REPO OWNER>",
"repo": "<GITHUB REPO>",
"aws_account_id": "<AWS ACCOUNT ID>",
"aws_region": "<AWS REGION>",
"riot_key": "<RIOT API KEY>",
"dev": {
"discord_public_key": "<DISCORD PUBLIC KEY>",
"application_id": "<DISCORD APPLICATION ID>",
"token": "<DISCORD BOT TOKEN>"
},
"prod": {
"discord_public_key": "<DISCORD PUBLIC KEY>",
"application_id": "<DISCORD APPLICATION ID>",
"token": "<DISCORD BOT TOKEN>"
}
}
npm run start
In the repo, under Settings > Secrets and variables > Actions, create three new repository secrets
Repeat step 1 for Secrets and variables > Dependabot
Additionally, create a new environment called dev and create three new environment secrets
Repeat step 3 for prod