1.4.4 • Published 1 year ago

streambot.js v1.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

streambot.js

node-current GitHub npm

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
  • YouTube.com

Source Requirements:

  • Twitch.tv
    • A valid SSL certificate (privkey & fullchain) to sign subscriptions
    • External port 443 open (if hosting an HTTPS app with expressjs use the middleware)
  • YouTube.com
    • An API key with YouTube Data API v3 enabled

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);
});
1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.2.2

2 years ago

1.3.0

1 year ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago