https://anidiots.guide/getting-started/getting-started-long-version
Following along above link will give you
- App registered to be bound to a bot aka our Nodejs discord bot
- A token that you need to place into
.env
file
Install packages
$ yarn
or
$ npm install
Prepare .env
$ pwd # ensure you are in friendlybot folder
$ cp .env.example .env # Copied existing .env template
# add your discord bot secret key into .env.
# You must have it if you've followed `1. Set up Discord bot and generate a token` step
# Then place these variables into .env file
.env file may look like
---
MESSAGE_QUEUE=memory
DISCORD_PRIV_KEY=<key>
---
# These keys will be automatically picked up by src/config/index.js and assign
# it to process.env
To start (for dev)
$ yarn dev
To start (for prod)
$ yarn start
To build
$ yarn build
or
$ npm run build
# Ensure you have docker-compose and docker installed
$ docker-compose -f compose.dev.yml build
$ docker-compose -f compose.dev.yml up
docker run \
--rm \
-v /c/Users/Shin/Desktop/deepcollege/friendlybot:/home/node/app \
-v /home/node/app/node_modules \
friendlybot:latest \
yarn test
To lint
$ yarn lint
or
$ npm run lint
or
docker run -v <path to source code>:/home/node/app -v /home/node/app/node_modules friendlybot:latest yarn lint
To fix formats
$ yarn fix
or
$ npm run fix
or
docker run -v <path to source code>:/home/node/app -v /home/node/app/node_modules friendlybot:latest yarn fix
ARCHITECTURE.md
located underdocs/
will give you big picture understanding about friendlybot architectureDEPLOYMENT_TO_HEROKU.md
can be used to deploy the bot on to Heroku at the moment we intend to use Heroku for production bot only
1. Newsroom cron
2. Ask news aka search
3. On demand news (Direct message)
- Question bot
- Translation