Skip to content

davidscholberg/sunbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sunbot

sunbot is a serverless Discord bot that may or may not shine brighter than the sun (more than likely the latter).

Serverless?

Yes! sunbot operates on the serverless computing model. This means that rather than continuously run, sunbot sits behind a webserver and only runs when requests come in. This is possible due to Discord's support for interactions via webhooks.

Currently, sunbot will work out of the box as a AWS Lambda function, provided that you change the handler setting to src/index.handler.

Configuration

cp .env.sample .env
chmod 600 .env

Edit .env as needed.

Deployment

npm run deploy

The deployment script assumes that you're using AWS Lambda to host sunbot and that you have AWS CLI installed and configured.

Development

Install the pre-commit git hook to automatically run the unit tests before each commit:

npm run precommit

Project Directory Structure

  • src/
    • bot/ - The core code of the bot lives here.
    • commands/ - Each Discord command managed by sunbot is defined in a file in this directory.
    • lib/ - General library code should go here.
    • index.js - This is the entry point of the bot's request handler.
    • run_register_commands.js - This script registers the bot's commands to Discord. It exists outside of the request handler because it only needs to be run when a command is added or updated. The npm run deploy script runs this script automatically.

Credits

Most of the core code in this bot is based on code from Build a Discord Bot With AWS Lambda + API Gateway by jakjus.

About

serverless Discord bot that may or may not shine brighter than the sun (more than likely the latter)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors