Serverless Discord bot to ping moderators about a message
Create a Discord bot in the developer portal with the following settings:
- Installation:
- Installation Contexts: Guild Install
- Install Link: None
- Bot:
- Public Bot: No
- Message Content Intent: Yes
To invite the bot to your server, go to the OAuth2 page and select the following options to generate an invite URL:
- Scopes:
bot,applications.commands - Integration Type: Guild Install
Create a file called .env with the following contents:
# Bot values from developer portal
BOT_ID="..."
BOT_PUBLIC_KEY="..."
BOT_TOKEN="..."
# Channel ID to send messages to
CHANNEL_ID="..."
# Server ID to allow the command to be used in
GUILD_ID="..."
# Role ID to ping in messages marked urgent
MOD_ROLE_ID="..."Sync guild/global slash commands:
yarn sync guild --guildId ...
yarn sync allDeploy the CDK stack for dev or prod:
aws configure sso
yarn deploy-dev
yarn deploy-prodPaste the value of the FunctionUrl output into the Interactions Endpoint URL field in the developer portal.