Skip to content

Commit

Permalink
Add new docs for notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoTheTaco committed Oct 19, 2022
1 parent e87450b commit 8c2b864
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 19 deletions.
20 changes: 1 addition & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,25 +243,7 @@ This is useful if you still want to claim community points.
- `file`: Path of the log file (default: `log-XXXXXXXXXX.txt`). If you use this option, the file will be overwritten whenever you restart the app!
- `level`: The level of logging to write to the log file. One of: `debug` (default), `info`, `warn`, `error`.

`notifications` - Change options related to notifications. This should be in JSON format.

Each notification object should have these properties:

- `events`: A list of events to get notifications for. Possible events are:
- `drop_claimed`: A drop is claimed.
- `new_drops_campaign`: A new Drops campaign was found.
- `games`: Which games you want notifications for. Options are:
- `config`: Only get notifications related to games that are listed in the config.
- `all`: Get notifications related to any game.

Specific notification properties:

- `discord`: An array of discord notification objects. Each notification object has the following properties + the above ones:
- `webhook_url`: The URL of the Discord webhook.

- `telegram`: An array of telegram notification objects. Each notification object has the following properties + the above ones:
- `token`: The API token of your bot.
- `chat_id`: The chat ID where to post the message.
`notifications` - See [Notifications](docs/notifications.md) for more details.

### Update Games List

Expand Down
81 changes: 81 additions & 0 deletions docs/notifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Notifications

## Example

```
"notifications": {
"discord": [
{
"webhook_url": "https://discord.com/api/webhooks/abcde",
"events": {
"new_drops_campaign": {
"games": "all"
},
"drop_claimed": {
"games": "config"
},
"community_points_earned": {
"reasons": [
"claim",
"streak",
"raid"
]
},
"drop_ready_to_claim": {}
}
}
],
"telegram": [
{
"token": "abcde",
"chat_id": "12345",
"events": {
"new_drops_campaign": {
"games": "all"
},
"drop_claimed": {
"games": "all"
},
"community_points_earned": {
"reasons": []
},
"drop_ready_to_claim": {}
}
}
]
}
```

## Events

### new_drops_campaign

Sent when a new Drops Campaign is detected.

- `games` - One of the below options.
- `all` - Notify for all games.
- `config` - Notify only for games specified in the config.

### drop_claimed

Sent when a Drop Reward is claimed.

- `games` - One of the below options.
- `all` - Notify for all games.
- `config` - Notify only for games specified in the config.

### community_points_earned

Sent when community points are earned.

- `reasons` - A list of reasons to notify for. Options shown below. Leave blank to be notified for all reasons.
- `watch` - Points earned every few minutes for watching.
- `claim` - Points earned when clicking "claim points" button.
- `watch_streak` - Points earned from a watch streak.
- `raid` - Points earned for joining a raid.

### drop_ready_to_claim

Sent when the bot detects that a Drop Reward in your inventory is ready to claim. This may be sent multiple times for the same Drop Reward.

- `<no options>`

0 comments on commit 8c2b864

Please sign in to comment.