Socket
Socket
Sign inDemoInstall

tmi.js

Package Overview
Dependencies
8
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.19 to 0.0.20

112

lib/client.js

@@ -196,15 +196,5 @@ var commands = require("./commands");

// This room is now in slow mode. You may send messages every slow_duration seconds.
// Moved to ROOMSTATE.
case "slow_on":
// TODO: Display seconds..
self.log.info("[" + message.params[0] + "] This room is now in slow mode.");
self.emit("slow", message.params[0], true);
self.emit("slowmode", message.params[0], true);
break;
// This room is no longer in slow mode.
case "slow_off":
self.log.info("[" + message.params[0] + "] This room is no longer in slow mode.");
self.emit("slow", message.params[0], false);
self.emit("slowmode", message.params[0], false);
break;

@@ -246,62 +236,39 @@

// You are permanently banned from talking in channel.
// Send the following msg-ids to the notice event listener..
case "already_subs_off":
case "bad_commercial_error":
case "bad_unban_no_ban":
case "ban_success":
case "color_changed":
case "commercial_success":
case "msg_banned":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// You cannot whisper to yourself.
case "whisper_invalid_self":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// This room is in subscribers only mode. To talk, purchase a channel subscription at [...]
case "msg_duplicate":
case "msg_subsonly":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// Your message was not sent because you are sending messages too quickly.
case "msg_duplicate":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// Unrecognized command: /..
case "no_permission":
case "timeout_success":
case "unban_success":
case "unrecognized_cmd":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// You are sending whispers too fast. Try again in a second.
case "usage_ban":
case "usage_clear":
case "usage_color":
case "usage_commercial":
case "usage_host":
case "usage_mod":
case "usage_r9k_on":
case "usage_r9k_off":
case "usage_slow_on":
case "usage_slow_off":
case "usage_subs_on":
case "usage_subs_off":
case "usage_timeout":
case "usage_unban":
case "usage_unhost":
case "usage_unmod":
case "whisper_invalid_self":
case "whisper_limit_per_min":
case "whisper_limit_per_sec":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// You are sending whispers too fast. Try again in a second.
case "whisper_limit_per_min":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// Usage: "/color <color>" - Change your username color. Color must be in hex (#000000) or one of the following: [...].
case "usage_color":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// Your color has been changed.
case "color_changed":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// You don't have permission to perform that action.
case "no_permission":
self.log.info("[" + message.params[0] + "] " + message.params[1]);
self.emit("notice", message.params[0], message.tags["msg-id"], message.params[1]);
break;
// Ignore this because we are already listening to HOSTTARGET.

@@ -390,2 +357,15 @@ case "host_on":

self.emit("roomstate", message.params[0], message.tags);
// This room is now in slow mode. You may send messages every slow_duration seconds.
if (message.tags.hasOwnProperty("slow") && !message.tags.hasOwnProperty("subs-only")) {
if (typeof message.tags.slow === "boolean") {
self.log.info("[" + message.params[0] + "] This room is no longer in slow mode.");
self.emit("slow", message.params[0], false, 0);
self.emit("slowmode", message.params[0], false, 0);
} else {
self.log.info("[" + message.params[0] + "] This room is now in slow mode.");
self.emit("slow", message.params[0], true, message.tags.slow);
self.emit("slowmode", message.params[0], true, message.tags.slow);
}
}
break;

@@ -392,0 +372,0 @@

@@ -0,0 +0,0 @@ var bunyan = require("bunyan");

@@ -31,26 +31,2 @@ var toNumber = require("underscore.string/toNumber");

function stringifyPrimitive(v) {
switch (typeof v) {
case 'string': return v;
case 'boolean': return v ? 'true' : 'false';
case 'number': return isFinite(v) ? v : '';
default: return '';
}
}
function queryString(object) {
if (object === null || !object) { object = {}; }
return Object.keys(object).map(function(k) {
var ks = encodeURIComponent(stringifyPrimitive(k)) + '=';
if (Array.isArray(object[k])) {
return object[k].map(function(v) {
return ks + encodeURIComponent(stringifyPrimitive(v));
}).join('&');
} else {
return ks + encodeURIComponent(stringifyPrimitive(object[k]));
}
}).join('&');
}
exports.generateJustinfan = generateJustinfan;

@@ -61,2 +37,1 @@ exports.isInteger = isInteger;

exports.normalizePassword = normalizePassword;
exports.queryString = queryString;
{
"name": "tmi.js",
"version": "0.0.19",
"version": "0.0.20",
"description": "Javascript library for the Twitch Messaging Interface.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,2 +0,2 @@

# tmi.js - WORK IN PROGRESS
# tmi.js
[![Build Status](https://secure.travis-ci.org/Schmoopiie/tmi.js.png?branch=master)](https://travis-ci.org/Schmoopiie/tmi.js) [![Downloads](http://img.shields.io/npm/dm/tmi.js.svg?style=flat)](https://www.npmjs.org/package/tmi.js) [![Npm Version](http://img.shields.io/npm/v/tmi.js.svg?style=flat)](https://www.npmjs.org/package/tmi.js) [![Node Version](https://img.shields.io/node/v/tmi.js.svg?style=flat)](https://www.npmjs.org/package/tmi.js) [![Issues](http://img.shields.io/github/issues/Schmoopiie/tmi.js.svg?style=flat)](https://github.com/Schmoopiie/tmi.js/issues)

@@ -8,2 +8,6 @@

## Beta
We are still in beta and we are doing our best to fix issues as soon as possible. Make sure the module is updated to the latest version before reporting issues. We are bumping the beta version at least once a week. Undocumented NOTICE messages should be reported [here](https://github.com/Schmoopiie/tmi.js/issues/28) and other issues (during beta) should be reported [here](https://github.com/Schmoopiie/tmi.js/issues/3) or [create a new issue](https://github.com/Schmoopiie/tmi.js/issues/new).
## Get involved!

@@ -10,0 +14,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc