Skip to content

Commit

Permalink
Merge pull request #80 from nullabork/betabot
Browse files Browse the repository at this point in the history
Betabot
  • Loading branch information
wootosmash committed Jan 8, 2020
2 parents 0ec841c + 435a1f6 commit 1875e0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Each of these services can be turned on and off in the configuration of the bot.
- git

Several of the in use NPM packages may require the following:
- ffmpeg - https://www.ffmpeg.org/download.html
- cmake - https://cmake.org/download/
- python - https://www.python.org/downloads/ - v2.7.* is usually required
- Visual Studio C++ build tools or Visual Studio with full C++ support
Expand All @@ -69,10 +68,14 @@ Several of the in use NPM packages may require the following:
* To learn how to setup a discord app and get this token [go here](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
3. Setup your Google API credentials.
* To learn how to do this [go here](https://cloud.google.com/text-to-speech/docs/quickstart-client-libraries)
4. Install cmake, ffmpeg, python v2.7 and Visual Studio C++ build tools
4. Install cmake, python v2.7 and Visual Studio C++ build tools
* See the URLs in the software requirements for how to do this
5. Install NPM dependencies
* `npm install`
```yaml
npm install
npm rebuild
npx patch-package
```
6. Run the bot!
* `node bot.js`

Expand Down
3 changes: 3 additions & 0 deletions src/services/tts/AzureTextToSpeechAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class AzureTextToSpeechAPI extends TextToSpeechService {

try {
self.accessToken = await self.getAccessToken(subscriptionKey);

// accessToken expires after an hour so we need to renew it
setInterval(() => self.getAccessToken(auth.tts.azure.subscriptionKey).then((token) => { self.accessToken = token }), 10 * 60 * 1000);
var v = await self.getVoicesFromAzure(self.accessToken);
AzureTextToSpeechAPI.voices = self.processVoices(v);
} catch (err) {
Expand Down

0 comments on commit 1875e0c

Please sign in to comment.