Skip to content

deepcollege/bot

Repository files navigation

DeepCollege Operational Assistant

Build Status Discord

Instruction

1. Set up Discord bot and generate a token

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

2. Setup your development environment

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

3. Initiate

a) bare-metal node approach

To start (for dev)

$ yarn dev

To start (for prod)

$ yarn start

To build

$ yarn build
or 
$ npm run build
b) docker-compose (preferred method)
# Ensure you have docker-compose and docker installed
$ docker-compose -f compose.dev.yml build
$ docker-compose -f compose.dev.yml up

4. Tests

 docker run \
  --rm \
  -v /c/Users/Shin/Desktop/deepcollege/friendlybot:/home/node/app \
  -v /home/node/app/node_modules \
  friendlybot:latest \
  yarn test

4. Code quality

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

Useful links

  • ARCHITECTURE.md located under docs/ will give you big picture understanding about friendlybot architecture
  • DEPLOYMENT_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

Backlogs

1. News

1. Newsroom cron 2. Ask news aka search 3. On demand news (Direct message)

2. Chatbot

  1. Question bot
  2. Translation

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published