Skip to content

Commit

Permalink
Fixed TTS logic for the new googleTTS API update. (#28)
Browse files Browse the repository at this point in the history
* Updated dependencies and added linter.

* Added scripts and bumped version.

* Added CI workflow.

* Created a settings file.

* Cleaned up main app file and moved utils functions into Client.

* Fixed imports in commands.

* Fixed linting issues.

* Removed utils file.

* Edited TTS logic to work with the dependency update.

* Edited heroku app.json

* Updated README.
  • Loading branch information
moonstar-x authored Dec 29, 2020
1 parent 1525c5e commit 52d722c
Show file tree
Hide file tree
Showing 27 changed files with 7,998 additions and 575 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": [
"greencoast/node"
],
"rules": {
"one-var": "off"
},
"parserOptions": {
"ecmaVersion": 2020
}
}
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install Dependencies
run: npm ci

- name: Lint Files
run: npm run lint
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ Then, inside the `config` folder, rename the file *settings.json.example* to *se

{
"discord_token": "YOUR_DISCORD_TOKEN",
"prefix": "$",
"allow_more_than_200_chars": "yes"
"prefix": "$"
}

The `allow_more_than_200_chars` property lets you choose wether you want TTS messages longer than 200 characters to be played (default: `yes`).
You may also configure these options with the respective environment variables: `DISCORD_TOKEN` and `PREFIX`. The settings set with the environment variables will take higher precedence than the ones in the config JSON file.

Install the dependencies:

Expand Down
5 changes: 0 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"DISCORD_TOKEN": {
"description": "Your bot's bot token.",
"required": true
},
"ALLOW_OVER_200": {
"description": "Type 'yes' if you wish to send TTS messages of over 200 characters long.",
"required": true,
"value": "yes"
}
}
}
3 changes: 1 addition & 2 deletions config/settings.json.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"discord_token": "YOUR_DISCORD_TOKEN",
"prefix": "$",
"allow_more_than_200_chars": "yes"
"prefix": "$"
}
Loading

0 comments on commit 52d722c

Please sign in to comment.