lmariscal / twitchirc

Twitch Bot Development made Easier | DEPRECATED
Other
40 stars 15 forks source link

React to normal messages #7

Closed mvarendorff closed 7 years ago

mvarendorff commented 7 years ago

I got curious and forked the project to work on a bot that I could use or help out channels I want to support with it with features they might like. However after testing, trying and many hours I cannot figure out how to react on simple, normal messages that are written in the chat. I am in the correct chat (tested with reading the active users and sending messages to it) and I can see a reaction on whispering to the bot in the console, but nothing happens, when I write any text in the chat. According to the documentation it should still be something with PRIVMSG, but even if I printed everything read by the bot in the console nothing is displayed there. Am I missing anything, am I straightup dumb or is this actually not working anymore? Help is much appreciated!

Greetings geisterfurz007

Edit: I followed the wiki after beeing unsuccessful with my own attempts, but here I had the same problem. As said I both did override the onMessage method as well as just print everything that is recorded by the reader and neither did anything...

lmariscal commented 7 years ago

(Sry for the long wait) All this lib whas made before the:

2015 June 10 Product Twitch rolls out a private messaging system called Whisper, allowing users to send private chat messages without leaving their current chat.[25]

So all of the features are working (Or they should the irc protocol of Twitch hasn't change). But as I saw all this new features I was in school so I decided to discontinue this project. So yeah, PRIVMSGs are not working. But please don't get discoraged by this feel free to work in your fork and continue doing an amazing job :+1:.

About the messages in the chat that are not appearing, they should if you follow the wiki you should be able to create a basic bot working on the chat. (Alot of devs of bots in twitch decided to move to privmsg because as you can see when alot of commands come in the chat gets spammed.) Sry if their is any incovenience I will do what I can to help you. :)

Edit: To fully corroborate my data I will do some test in a test project. I will post in here the results!

lmariscal commented 7 years ago

Yep I just tested it. And everything works as it should I'm receiving messages and I'm able to connect and send some messages too.

I ask you some things that could be your problem, firtst of all onMessage function with the override in the bot's class or in the main? Because if it's in the main one it won't work. Second, be sure to be able to join and send messages in the chat with your bot. Third be sure that you are able to connect to twitch with your username and ouath token (everything in the wiki.)

Any other problem you could be experimenting I'm here to help. Gl

mvarendorff commented 7 years ago

Huh, interesting... 1) Yup, onMessage is overridden in my Bot-class 2) Yup as well. I get the standard output and I am able to send Messages 3) I generated a new token this morning for the bot's account, so that should not be the problem either... And if it is able to send messages, it should already be authorized, shouldn't it? And as said, I can whisper the bot as well, but not get it to react on normal messages.

bot_no_messages

In the image I had your library modified in the way that as first action after reading a new line, it is printed out as soon as read to have everything in the console, hence the slight chaos. But as you can see there is no console reaction in the console to the message I wrote in chat. In addition to that, I did override the onMessage method, but as there is nothing from that it should be triggered, nothing happens from it either...

And I just went through the wiki and backchecked everything and it should work, but I am unable to actually get it to.

mvarendorff commented 7 years ago

Huh... I took the time now and followed your wiki exactly and this seems to be working.. I will try to backtrack and if I found, what was causing the issue I would leave a note here, if that is ok for you :smile:

mvarendorff commented 7 years ago

After some searching, copying and pasting I found the problem. It was one # when joining a channel. I saw that in the code it was added, so I left it out, but it does make a difference, eventhough I cannot figure out why it does. I can send messages in that channel, read the viewers, but I cannot see messages, when they are posted. I am uncertain why that is and I have not yet taken the time to investigate, but maybe you could look into that as well if you have a minute free. Maybe I just misunderstood your code though, even if I am certain I didn't. Anyways this seems to be working now :D