Skip to content

coolfriends/coolpal

Repository files navigation

CoolPal

A cool pal ready to hang out in your Discord server

Build Status Coverage Status License: MIT Inline docs code style: prettier

Download repo and install dependencies

Requirements

  • node v8.0.0 or greater
  • npm dependencies

Install node v8.0.0 or greater

Install globally with your package manager, or use nvm: https://github.com/creationix/nvm

Download project & change directories

git clone https://github.com/coolfriends/coolpal.git
cd coolpal

Download dependencies

npm install

Link the local executable to your /usr/bin path

npm link
coolpal --help

Run coolpal on local machine

Run bundle steps

npm run bundle

Run bot

npm start

Run bot as daemon with Forever from source directory

forever start --minUptime 100000000 ./dist/bin.bundle.js

Configuration

When looking for a configuration file, the following are checked in order:

  1. CLI argument
  2. Default configuration file name

To start the bot without putting a token in the configuration file, export the following environment variable:

export COOLPAL_DISCORD_TOKEN="your-token"

Build docker image and run coolpal in container

Make sure you have docker installed: https://docs.docker.com/engine/installation/

Build image from Dockerfile

docker build --no-cache -t coolpal .

Run container in detached mode

docker run -d coolpal

Run container and enter shell

docker run -it coolpal

Run the tests

Make sure to run npm install to get the mocha dev dependency. Then run the tests like so:

npm test


## Create docs

```bash
npm run docs

Format code

npm run format
## Pre-commit

The `precommit` script in `package.json` runs on any add. This will enforce
good style. Make sure to have the latest dev-deps installed with `npm install`

Todo

  • Get webpack working with a shebang line in bin/coolpal so it can become a linked executable with npm link