Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TychoTheTaco/Twitch-Drops-Bot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: UpDownLeftDie/Twitch-Drops-Bot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 11 commits
  • 14 files changed
  • 3 contributors

Commits on Feb 26, 2023

  1. fix sha256Hash

    deathart committed Feb 26, 2023
    Copy the full SHA
    594d623 View commit details

Commits on Mar 21, 2023

  1. Update twitch.ts

    deathart authored Mar 21, 2023
    Copy the full SHA
    1c952ba View commit details

Commits on May 3, 2023

  1. Copy the full SHA
    3f04539 View commit details
  2. enable pre-commit

    jaredcat committed May 3, 2023
    Copy the full SHA
    0890185 View commit details
  3. clean up markdown styling

    jaredcat committed May 3, 2023
    Copy the full SHA
    0b7c0d2 View commit details
  4. Copy the full SHA
    401c9fe View commit details
  5. Fix typo in options.md

    jaredcat committed May 3, 2023
    Copy the full SHA
    4849064 View commit details
  6. Copy the full SHA
    025bd4f View commit details
  7. use new headless browser

    jaredcat committed May 3, 2023
    Copy the full SHA
    8291624 View commit details
  8. Copy the full SHA
    d5caf4a View commit details

Commits on Jun 7, 2023

  1. Copy the full SHA
    8dae61f View commit details
Showing with 1,092 additions and 8,211 deletions.
  1. +2 −1 .eslintrc.cjs
  2. 0 .husky/pre-commit
  3. +27 −0 .vscode/settings.json
  4. +7 −7 README.md
  5. +8 −8 docs/notifications.md
  6. +3 −3 docs/options.md
  7. +627 −7,856 package-lock.json
  8. +17 −15 package.json
  9. +3 −3 src/index.tsx
  10. +13 −4 src/twitch.ts
  11. +15 −13 src/twitch_drops_bot.ts
  12. +1 −2 src/update_games.ts
  13. +6 −5 src/web_socket_listener.ts
  14. +363 −294 test/notifier.test.ts
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -17,9 +17,10 @@ module.exports = {
"unused-imports",
"eslint-plugin-jest"
],
"ignorePatterns": ["node_modules", "dist"],
"rules": {
"unused-imports/no-unused-imports": "error",
"semi": ["error", "always"],
"quotes": ["error", "double", {"avoidEscape": true}]
}
}
};
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ Linux: `docker run --rm -v "${PWD}":/app/data -i -t --sig-proxy=false ghcr.io/ty

To detach from the docker session without terminating it, use `CTRL-P` `CTRL-Q`.

##### Troubleshooting
##### Troubleshooting Docker

`docker: Error response from daemon: create %cd%: "%cd%" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.`

@@ -64,8 +64,8 @@ Make sure to install the latest version of Node.js, look at [this link](https://
To install Node.js 16 use the following commands:

```sh
$ sudo curl -sL https://deb.nodesource.com/setup_16.x | bash -
$ sudo sudo apt-get update && apt-get install -y nodejs
sudo curl -sL https://deb.nodesource.com/setup_16.x | bash -
sudo sudo apt-get update && apt-get install -y nodejs
```

## Options
@@ -87,13 +87,13 @@ Try increasing `load_timeout_secs` to `60` or `90`.

## FAQ

#### The game I want to watch is not in `games.csv`. Can I still use this bot for that game?
### The game I want to watch is not in `games.csv`. Can I still use this bot for that game?

Yes, you can use this bot for any game! The `games.csv` file is provided for convenience and might be missing some games, but you can find a game's ID yourself by following these steps.
Open the game's main page on Twitch, for example, Rocket League: https://www.twitch.tv/directory/game/Rocket%20League. Right-click the game's image. Click `Inspect Element`. You should see something like this:
Open the game's main page on Twitch, for example, Rocket League: <https://www.twitch.tv/directory/game/Rocket%20League>. Right-click the game's image. Click `Inspect Element`. You should see something like this:

```
```html
<img alt="Rocket League" class="tw-image" src="https://static-cdn.jtvnw.net/ttv-boxart/30921-144x192.jpg">
```

The number in between `ttv-boxart/` and `-144x192.jpg` is the game ID. In this example it is `30921`.
The number in between `ttv-boxart/` and `-144x192.jpg` is the game ID. In this example it is `30921`.
16 changes: 8 additions & 8 deletions docs/notifications.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## Example

```
```json
"notifications": {
"discord": [
{
@@ -67,18 +67,18 @@ Sent when a new Drops Campaign is detected.
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.
- `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.
- `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

6 changes: 3 additions & 3 deletions docs/options.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ provided, a default config file will be generated.

A sample config file looks like this:

```
```json
{
"username": "my_twitch_username",
"password": "my_twitch_password",
@@ -123,7 +123,7 @@ then it will give priority to the one that ends first.
- Alias: `-i`
- Default: `15`

`‑‑browser‑args <args>` | `browser_args` Extra arguments to pass to the browser instance. If provided as a command line argument, this should be a comma-separated list of args. Note that `\ ` is used as an escape character so if you want to
`‑‑browser‑args <args>` | `browser_args` Extra arguments to pass to the browser instance. If provided as a command line argument, this should be a comma-separated list of args. Note that `\` is used as an escape character so if you want to
use a comma in one of the args, it needs to be escaped so this `--some-arg=a,b,c` would be `--some-arg=a\,b\,c` If provided in the JSON config, this should be an array of strings.

`‑‑watch‑unlisted‑games` | `watch_unlisted_games` When `true`, the app will watch streams of games that are not listed in the config if the listed games' campaigns are completed or no streams are active.
@@ -194,6 +194,6 @@ This is useful if you still want to claim community points.

- Default: `true`

`--auto-claim-community-points` | `auto_claim_community points` Automatically claim Community Points.
`--auto-claim-community-points` | `auto_claim_community_points` Automatically claim Community Points.

- Default: `true`
Loading