A Discord chat interaction (slash command) for generating user-timestamps.
Click here to authorize this interaction on your server. No further setup is required as this is the bot instance centrally hosted by us (gallowaylabs).
This application is tightly coupled to AWS; it uses AWS CDK, an AWS-flavored Terraform tool, to deploy resources and uses AWS-specific features like Lambda and ApiGateway.
Pre-requisites:
- An AWS account
- AWS CLI V2 installed and configured
- Node >16
- Install AWS CDK globally
npm install -g aws-cdk
- Install dependencies
npm i
- Generate an application and bot in the Discord developer portal
- Copy example configuration to active configuration
cp .env.example .env
- Fill in the
.env
configuration parameters with your AWS account id and Discord app/bot credentials - Deploy to AWS
cdk deploy --all
- After deployment, CDK will print the base URL for the API. Copy that to the "Interactions Endpoint URL" under "General Information" in the Discord Developer Portal
- Publish the command interaction definitions to Discord
npm run publishCommands
To add your newly created interaction to a server that you administer:
- in the Discord Developer Portal go to OAuth2 > URL Generator
- Select "applications.commands"
- Copy the generated link and go to it in a browser window where you're logged into Discord
- Authorize the application
- You can now use
/stamp
and/timestamp
commands in the server you authorized
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation templatenpm run publishCommands
publish interaction command structure to Discord
Timestamp icons created by Freepik - Flaticon: https://www.flaticon.com/free-icons/timestamp