Skip to content

Instantly share code, notes, and snippets.

@d0p3t
Created August 13, 2017 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d0p3t/295a67c3b2310a8df577b8270f261133 to your computer and use it in GitHub Desktop.
Save d0p3t/295a67c3b2310a8df577b8270f261133 to your computer and use it in GitHub Desktop.
var tmi = require('tmi.js');
var config = require('./config.js');
var client = new tmi.client(config.tmi);
client.connect();
client.on("subscription", function (channel, username, method, message, userstate) {
if (method.prime === true) {
console.log("Prime Sub");
client.say(channel, "/me galeHEART galeHEY " + username + " has just subscribed with Twitch Prime! galeHEART galeHEY");
}
else {
console.log("Normal Sub");
client.say(channel, "/me galeHEART galeHEY " + username + " has just subscribed! galeHEART galeHEY");
}
});
client.on("resub", function (channel, username, months, message, userstate, methods) {
if (methods.prime === true) {
console.log("Resub prime");
client.say(channel, "/me galeHEART RESUB HYPE galeHEART " + username + " has just re-subscribed for " + months + " months using Twitch Prime! galeHEY galeHEY (" + message + ")");
}
else {
console.log("Normal Sub");
client.say(channel, "/me galeHEART RESUB HYPE galeHEART " + username + " has just re-subscribed for " + months + " months! galeHEY galeHEY (" + message + ")");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment