tmijs / tmi.js

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

"self" parameter in message callback is always false #367

Closed marcospgp closed 4 years ago

marcospgp commented 4 years ago

Actual behaviour:

Using the code example in https://tmijs.com/ under "OAuth token authorization", the bot replies to itself when using the command !hello.

Expected behaviour: The self parameter in the message callback should be set to true and the bot should not reply to itself.

Error log:

[17:14] info: Connecting to irc-ws.chat.twitch.tv on port 443..
logger.js:11
[17:14] info: Sending authentication to server..
logger.js:11
[17:14] info: Connected to server.
logger.js:11
[17:14] info: Executing command: JOIN #youblicitybot
logger.js:11
[17:14] info: Joined #youblicitybot
logger.js:11
[17:14] info: [#youblicitybot] <youblicitybot>: !hello
[17:14] info: [#youblicitybot] <youblicitybot>: @youblicitybot, heya!

Is this only supposed to work for messages sent through client.say? I'm using the bot account to run the command on the chat, through the browser.

Server configuration

AlcaDesign commented 4 years ago

tmi.js will set the self argument to true when it's internally echoing the message it just sent. It's not for detecting if the user sending the message has the same username of the bot.