Package Exports
- streambot.js
- streambot.js/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (streambot.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
streambot.js
Library that exports a ready-to-use Discord bot that relays online stream status messages for your streamers of choice from supported platforms.
Currently supports:
- Twitch.tv
- Trovo.live
Requires a valid SSL certificate (privkey & fullchain) to sign Twitch subscriptions
Installation
npm install streambot.js
Standalone Usage
const bot = new StreambotJs(opts, sslCert);
bot.init(opts).subscribe();
Express Middleware
const app = express();
const bot = new StreambotJs(opts, sslCert);
await bot.expressMiddleware.apply(app);
app.listen(443, () => {
bot.init(opts).subscribe();
});
Loading and saving configuration
To allow more flexibility for the end user's storage choices, the library doesn't store its configuration to any file.
To load existing configuration from storage: You should load your configuration before initializing the bot
const configuration: StreambotJsConfiguration = getFromStorage();
bot.setConfiguration(configuration);
bot.init(opts).subscribe();
To subscribe to configuration changes
bot.configurationChanges.subscribe((configuration: StreambotJsConfiguration) => {
saveToStorage(configuration);
});