Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tmi = require ('tmi.js');
- var options = {
- options: {
- debug: true
- },
- connection: {
- cluster: "aws",
- reconnect: true
- },
- identity: {
- username: "enoladesert",
- password: "oauth:oathcode987654321"
- },
- channels: ["enoladesert"]
- };
- var client = new tmi.client(options);
- client.connect();
- client.on("subscription", function (channel, username) {
- switch (channel) {
- case '#enoladesert':
- client.action(channel, "imGlitch <3 Welcome " + username + " to the Enolaroos! <3 imGlitch");
- break;
- }
- });
- client.on("resub", function (channel, username, months, message) {
- switch (channel) {
- case '#enoladesert':
- client.action(channel, "imGlitch <3 Welcome back " + username + " to the Enolaroos! <3 imGlitch");
- break;
- }
- });
- client.on("cheer", function (channel, userstate, message) {
- var twitchname = userstate['display-name'];
- if (userstate['display-name'] == null) {
- var twitchname = userstate.username;
- }
- switch (channel) {
- case '#enoladesert':
- client.say(channel, "TwitchRPG Thanks for the " + userstate.bits + " bits, " + twitchname + "!");
- break;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement