Skip to content

Commit

Permalink
Merge pull request #3 from MELLIFERA-Labs/feature/discord-support
Browse files Browse the repository at this point in the history
feature: discord support & cli feature
  • Loading branch information
RuslanGlaznyov authored Apr 17, 2022
2 parents 3e8553e + e64e801 commit 0995f4b
Show file tree
Hide file tree
Showing 18 changed files with 703 additions and 88 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
node_modules/
config/*.config.js
config.js
data/*.json
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,35 @@ requirements:
node.js >=16.14.2
```

### Install dependencies

Install dependencies

`npm install`

Before run, store a `config.js` file in the project folder. The config sample can be find in `config.sample.js`
```
npm install
```
### Set up storage with command
```
npm run setup
```
### Set up configs.

AND
Before run, store a `global.config.js` file in the project config folder. The config sample can be find in config folder `global.config.sample.js`
- SET `telegram` config.
If you want to run message via telegram transport, create `telegram.config.js` in `config/` folder. Sample is `telegram.config.sample.js`
- SET `discord` config. If you want to run message via discord transport, create `discord.config.js` in `config/` folder. Sample is `discord.config.sample.js`
- SET both config if you want to run `discord` and `telegram`

Add to data folder `telegram.json` file with default params `{ "last_notified_proposal_id": 0 }`

RUN with cron:
### RUN with cron:

example:
example with 2 transports:
```
*/30 * * * * cd /user/Heimdallbot && npm start -- --telegram --discord --silent >> /user/heimdallbot.log
```
*/30 * * * * cd /user/Heimdallbot && npm run run:tlg --silent >> /user/heimdallbot.log
example with 1 transports:
```
*/30 * * * * cd /user/Heimdallbot && npm start --silent -- --telegram >> /user/heimdallbot.log
```

if use `nvm` do alias

```
Expand Down
4 changes: 4 additions & 0 deletions config/discord.config.sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
BOT_TOKEN: 'required',
CHAT_ID: 'required',
}
3 changes: 3 additions & 0 deletions config/global.config.sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
PROPOSALS_API_REST_URL: 'required',
}
4 changes: 4 additions & 0 deletions config/telegram.config.sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
BOT_TOKEN: 'required',
CHAT_ID: 'required',
}
Loading

0 comments on commit 0995f4b

Please sign in to comment.