- Install Docker and docker-compose.
- Copy
dev.env.template
to.env
and fill in the tokens. - Install dependencies with
yarn install
. - You can run a local dev postgres container with
yarn db:start
. - Run the bot with
yarn start
.
- Publish commands with
yarn commands:deploy
. - Build and push docker image (or let GH action do it for you).
- Run docker image via production docker-compose file (found in separate repo).
Key | Description |
---|---|
DB_USER | User for the Postgres DB |
DB_PASSWORD | Password for the Postgres DB |
DISCORD_TOKEN | Discord bot token |
DICTIONARY_APP_ID | App ID for Oxford dictionary account |
DICTIONARY_APP_KEY | App key for Oxford dictionary account |
SHIRITORI_WORD_CHECK | Set to "true" to enable checking the dictionary API for shiritori word validity |
OPENAI_DISABLE | Set to "true" to disable using the OpenAI API |
OPENAI_API_KEY | API key for OpenAI |
# Generate TypeORM migration
yarn typeorm migration:generate -d src/database/source.ts -p ./src/database/migrations/MIGRATION_NAME
# Migrating production
sudo docker exec -it sockbot-discord sh
yarn typeorm migration:run -d src/database/source.ts
# Build and push docker instance
docker build -t averagewizard13/sockbot-discord:dev .
docker push averagewizard13/sockbot-discord:dev
# Bump yarn version
yarn version
yarn version --prerelease --preid=alpha
# Deploying commands from prod
sudo docker exec -it sockbot-discord yarn commands:deploy