Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const tmi = require('tmi.js')
- const username = 'TWITCH_USERNAME'
- const password = 'TWITCH_OAUTH'
- const options = {
- connection: {
- reconnect: true,
- },
- identity: {
- username,
- password,
- },
- channels: ['#zizaran']
- }
- const bot = new tmi.client(options)
- bot.on('subscription', (channel, username, method, message, userstate) => {
- switch (channel) {
- case '#zizaran':
- zizSub(channel, username, null, method, message, userstate)
- default:
- return
- }
- })
- bot.on('resub', (channel, username, months, message, userstate, methods) => {
- switch (channel) {
- case '#zizaran':
- zizSub(channel, username, months, methods, message, userstate)
- }
- })
- function zizSub(channel, username, months, methods, message, userstate) {
- const resubMessage = `${months} months?!! Welcome back to the team ${username}!!! zizTeam zizTeam zizTeam zizTeam zizTeam zizTeam zizTeam zizTeam `
- const subMessage = `Welcome to the team ${username}!! zizTeam zizTeam zizTeam zizTeam zizTeam zizTeam zizTeam zizTeam `
- if (!months) {
- console.log(`<info> [#zizaran] ${subMessage}`)
- bot.say(channel, subMessage)
- } else {
- console.log(`<info> [#zizaran] ${resubMessage}`)
- bot.say(channel, resubMessage)
- }
- }
- bot.connect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement