tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.56k stars 211 forks source link

The bot join the irc correctly but can't write #229

Closed Uranne closed 7 years ago

Uranne commented 7 years ago

Actual behaviour: Catch a string on the twitch chat, error on the function "client.say()"

Expected behaviour: Catch a string on the twitch chat, write an auto response

Code :

var tmi = require('tmi.js')
var oauth = require('./password.js')

var options = {
    options: {
        debug: true
    },
    connection: {
        reconnect: true
    },
    identitiy: {
        username: "boturanne",
        password: oauth.password
    },
    channels : ['#uranne']
}

var client = new tmi.client(options);

client.connect();
client.join("#uranne")
client.on("chat", (channel, user, message, self) => {
    if(self) return

    if(channel == "#uranne") {
        if(message == "ping"){
            client.say("#uranne", "pong")
        }
    }

})

Error log: http://puu.sh/vZa0K/f463d3a533.png

Server configuration

Schmoopiie commented 7 years ago

As mentioned in the docs and the README.md, this module currently supports Node 4.x. There is still no ETA when we will support Node 6.x and 7.x

Schmoopiie commented 7 years ago

Closing this as it is a duplicate of #201

Schmoopiie commented 7 years ago

Also, no need to double join your channel, you don't need to call client.join("#uranne") if you already have the channel in the options as they will be automatically joined once connected 😸

Uranne commented 7 years ago

Thank you :) I fixed the issu about my nodejs version. Now I don't have any error log, but, the function client.say() doesn't work ... (I put a console.log("Word received"), the console show it, but the bot doesn't talk.

http://puu.sh/vZg2v/f885e86dbe.png