Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twitchly

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitchly

Twitch API Client

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Twitchlie

A Node.js promise-based object-oriented Twitch client API. Twitchlie attempts to provide a familiar interface to Node.js developers as an alternate to tmi.js.

This software is in early development and interfaces are not well documented and are subject to change.

Install

Not yet published to NPM.

Usage

Example
const logger = require("jethro");

const Twitch = require("twitchlie");
const twitch = new Twitch({
    username: "<twitch username>",
    password: "<twitch oauth>",
    clientId: "<twitch client id>",
    clientSecret: "<twitch client secret>"
});

twitch.connect().then(function(d) {
    logger("info", "Twitch:IRCSocket", "Connection protocol complete");
    return twitch.join(["henchmun", "fuslie"]).then((users) => {
        console.log(users);
    });
}).catch(function(e) {
    logger("error", "Twitch:API", "Fatal error occurred: " + e.message);
    console.log("fatal error");
    console.error(e);
    process.exit(1);
});

twitch.on("socket:ping", function() {
    logger("info", "Twitch:IRCSocket", "Ping received");
});

twitch.on("socket:pong", function() {
    logger("info", "Twitch:IRCSocket", "Pong sent");
});

twitch.on("socket:connected", function() {
    logger("info", "Twitch:IRCSocket", "Connected");
});

twitch.on("socket:authenticated", function(username) {
    logger("info", "Twitch:IRCSocket", `Authenticated user: ${username}`);
});

twitch.on("socket:user_join", function(data) {
    logger("info", "Twitch:IRCSocket", `${data.username} joined #${data.channel}`);
});

twitch.on("socket:user_leave", function(data) {
    logger("info", "Twitch:IRCSocket", `${data.username} left #${data.channel}`);
});

twitch.on("socket:chat", function(data) {
    logger("info", "Twitch:IRCSocket", `${data.user.username}: ${data.message}`);
});

twitch.on("socket:message", function(message) {
    //console.log(message);
});

twitch.on("socket:chat", function(data) {
    logger("info", "Twitch:IRCSocket", `${data.user.username}: ${data.message}`);
});

Licensing

This software is provided as is and without warranty.

FAQs

Package last updated on 12 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc