Closed NiD27 closed 6 years ago
Yep that is possible! I am currently working on it; I will comment again once I am done :)
@geisterfurz007 bro i really cant tell how amazing you are thanks sooooo much
@NiD27 The code works and is tested. You can download the newest version of the TwitchBot.java on the branch "subpatch". That is the only required file to change for you. Or you backup your bot and download everything from that branch and put your stuff back in ^^
@geisterfurz007 thanks a lot mate cant tell how helpful you and this lib has been
@geisterfurz007 i have a question this function is called when someone hosts me right? or is it called when i host someone
The method will be called whenever any channel the bot is in is hosted by any other channel out there. Which channel has been hosted is in the Channel object and who hosted is in the User object.
wow its even better than what i wanted thanks mate
No problem! Hope it will serve you well ;)
ok i fully understand it now but since you did it using the pic i sent you at that time the code was logged in as the streamer and not as the bot so if anyone wants to run this they have to be logged in as the streamer
Dangit, you are right. I thought it was a general message sent to the channel and not the particular user. I will have a look on that again tomorrow. Thanks for reporting! I will be busy tomorrow so it will probably only be fixed in the evening if at all :)
@geisterfurz007 last time i did research it was not possible but good luck anyways im sure i can get around it using multiple accounts and objects but yeah anyways let this version be in anyways it gets it done
I am afraid, you are right.
NightDev created BetterTwitchTV as well so I guess they know what they say.
Looks like this will not happen in a way that it is reported to public I guess. Sorry.
The only idea that came to my mind just now would be adding something like a listener on a certain channel which would essentially be running a tiny bot that only has the onHost even and requires an oAuth token and username of the streamer as well as an action to perform. I am not sure how much traffic that would cause or whether that would be practical or not though.
Another alternative would be polling the unofficial twitch chat API under tmi.twitch.tv as described here
@geisterfurz007 yeah i beat around it using the streamers oauth but not all streamers will be so willling to give out oauth
The oauth token can only be used to connect to a socket (like this bot library does) and read the messages. It cannot be used as password or validation for anything else and can be revoked by them at any time (Settings -> Connections -> Forgot the name for the tool -> Revoke access; or something like that). And if your bot/the streamer using it wants the onhosted event, they have no other option (granted the feature is implemented).
ya the tmi or what ever tool i mean like you know if you dont really know that much about tech and you are about to send a weird gibbrish related to your account to a coder it kinda dont sound right but other than that it is safe i know that
That is why you should explain it thoroughly to them in "normal" vocabulary. Something like "Without this unique code I cannot detect whether you have been hosted. What it does is giving me access to reading messages in chat including those that are exclusively for your eyes as well (such as whisper and someone hosting you). I cannot use it to login to your account or similar things." (In theory you can as well send messages under their name with that which is something you might want to mention as well). If they want that feature, they have to trust you. If they don't, that is not your issue!
Currently I am working fulltime but from 5-th of March I am back in college and will have more time to implement both listeners (polling and the option if you have their credentials) but as said, that will take some time until I will get onto it. Closing this for now.
onHost
event
basically streamer is channel S and if any random channel R.. so if R hosts S the on hosted function is called on the streamer side. ive seen this being done in java script but cant find it in java this is the code ive used before in javascript - https://gyazo.com/97f5e9b947972d7ef621d18713eacca4 PS this should help toooo the bot is acting as the streamer with the streamers oauth and stuff - https://gyazo.com/d3ddbaa2f4d98a95109a8ccd72bde0c4 could also use a 'on' function which listens to irc if it already exists pls lemme know couldnt find it