Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const TwitchJS = require('twitch-js');
- //Install node and https://www.npmjs.com/package/twitch-js
- // Setup the client with your configuration; more details here:
- // https://github.com/twitch-apis/twitch-js/blob/master/docs/Chat/Configuration.md
- const options = {
- channels: ["#moonmoon_ow"],
- identity: {
- username: "FriendlyBaron",
- password: "oauth:changeMe"
- },
- clientId: "changeMe"
- };
- const client = new TwitchJS.client(options);
- var lastMsg = 0
- var lastMsgText = ""
- client.on('chat', (channel, userstate, message, self) => {
- //console.log(`Message "${message}" received from ${userstate['display-name']} in ${channel}`);
- if (self) return;
- var emotes = ["moon21", "moon22", "moon23", "moon24", "moon2A", "moon2BANNED", "moon2C", "moon2CD", "moon2COFFEE", "moon2CREEP", "moon2CUTE", "moon2D", "moon2DUMB", "moon2E", "moon2EZ", "moon2FEELS", "moon2GASM", "moon2GOOD", "moon2GUMS", "moon2H", "moon2HEY", "moon2KISSES", "moon2L", "moon2LUL", "moon2M", "moon2MD", "moon2MLADY", "moon2MLEM", "moon2MM", "moon2N", "moon2NOM", "moon2O", "moon2OWO", "moon2P", "moon2PLSNO", "moon2S", "moon2SHRUG", "moon2SMAG", "moon2SMUG", "moon2SPY", "moon2T", "moon2TEEHEE", "moon2W", "moon2WAH", "moon2WINKY", "moon2WOW", "moon2XD", "moon2YE"]
- /*if(userstate['display-name'].toLowerCase() == "plead" && Date.now()-3000 > lastMsg)
- {
- console.log(lastMsg + " plead attempting from " + userstate['display-name'])
- client.say(channel, userstate['display-name'] + " " + emotes[Math.floor(Math.random()*emotes.length)])
- lastMsg = Date.now()
- lastMsgText = userstate['display-name'] + " ppHop"
- }*/
- });
- client.on('connected', function(address, port) {
- console.log(">Connected<")
- });
- client.on('resub', function(channel, username, months, message, userstate, methods) {
- //console.log("resub")
- //client.say(channel, "moon2A Thanks for givin your lunch money for " + months + " months, " + username + " moon2A");
- });
- client.on('subscription', function(channel, username, method, message, userstate) {
- //console.log("normalsub")
- //client.say(channel, "moon2A Thanks for givin your lunch money, " + username + " moon2A");
- });
- client.on('subgift', function(channel, username, recipient, method, userstate) {
- //console.log("giftsub")
- //client.say(channel, "moon2A " + recipient + ", you will take this sub from " + username + " and you will like it moon2A");
- });
- client.connect();
- /*
- { badges: { subscriber: '0', bits: '1' },
- color: '#FF69B4',
- 'display-name': 'souljahboy',
- emotes: null,
- id: '868b4e34-cde6-4027-b522-6aca1e72fdd0',
- mod: false,
- 'room-id': '121059319',
- subscriber: true,
- 'tmi-sent-ts': '1530599857554',
- turbo: false,
- 'user-id': '172853390',
- 'user-type': null,
- 'emotes-raw': null,
- 'badges-raw': 'subscriber/0,bits/1',
- username: 'souljahboy',
- 'message-type': 'chat' }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement