Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Addition - Watchtime #16

Open
misterkoko opened this issue Nov 7, 2020 · 11 comments
Open

Addition - Watchtime #16

misterkoko opened this issue Nov 7, 2020 · 11 comments
Labels
good first issue Good for newcomers

Comments

@misterkoko
Copy link

misterkoko commented Nov 7, 2020

Hello!

Your script collects channel points without a hitch, but since it doesn't show you online in chat it doesn't increase your watchtime (I'm not a 100% sure that's how watchtime works).

Edit: I had your script running on a channel that has the command !watchtime enabled for an hour and my watchtime didn't increase by an hour.

Would it be possible you'd implement that you'd appear as if you're in the channels chat so it would increase the watchtime aswell as claim the points?

@gottagofaster236
Copy link
Owner

Thanks for your idea, I'll try to research that in the future. Right now I like how the script does not increase the view count of the stream, and thus does not act as a viewbot. I guess it could be optional then...

@misterkoko
Copy link
Author

Could maybe have two separate py scripts like main.py and main_chat.py. Your script already uses websocket and browser_cookie, so I guess you'd only need to collect the oauthToken, userID and clientID to be able to connect to chat (I think that's how it works but I could be wrong).

Thank you for taking it into consideration

@gottagofaster236 gottagofaster236 added the good first issue Good for newcomers label Nov 23, 2020
@gottagofaster236
Copy link
Owner

To join chat, you probably have to connect to Twitch IRC chat, as described in https://dev.twitch.tv/docs/irc/guide

@misterkoko
Copy link
Author

Connecting through the SSL websocket worked for me:

SENT: PASS oauth:

SENT: NICK rastafari90

RECEIVED: :tmi.twitch.tv 001 rastafari90 :Welcome, GLHF! :tmi.twitch.tv 002 rastafari90 :Your host is tmi.twitch.tv :tmi.twitch.tv 003 rastafari90 :This server is rather new :tmi.twitch.tv 004 rastafari90 :- :tmi.twitch.tv 375 rastafari90 :- :tmi.twitch.tv 372 rastafari90 :You are in a maze of twisty passages, all alike. :tmi.twitch.tv 376 rastafari90 :>

RECEIVED: PING :tmi.twitch.tv

SENT: PONG :tmi.twitch.tv

SENT: JOIN #lvndmark

RECEIVED: :rastafari90!rastafari90@rastafari90.tmi.twitch.tv JOIN #lvndmark

RECEIVED: :rastafari90.tmi.twitch.tv 353 rastafari90 = #lvndmark :rastafari90 :rastafari90.tmi.twitch.tv 366 rastafari90 #lvndmark :End of /NAMES list

RECEIVED: :lenblix!lenblix@lenblix.tmi.twitch.tv PRIVMSG #lvndmark :!sens

RECEIVED: :nightbot!nightbot@nightbot.tmi.twitch.tv PRIVMSG #lvndmark :@Lenblix - Tarkov - 400 dpi with 0.28 / 0.28 sensitivities (he was playing 0.45/0.45 prior)

image

So maybe the main_chat.py could connect you to the chat of the streamer you specify to get points on. Connect to the websocket, send the oauth token and nickname and the join command. And send the PONG :tmi.twitch.tv command every 5 minutes so you don't get disconnected from chat. After the streamer is offline just PART # to disconnect from chat

@ITR13
Copy link

ITR13 commented Dec 3, 2020

If implemented it would be nice if this was optional

@misterkoko
Copy link
Author

If implemented it would be nice if this was optional

I mentioned that in the 3rd comment: Could maybe have two separate py scripts like main.py and main_chat.py.

@jhagin002
Copy link

@misterkoko There is a much easier way to do this. All you have to do is download Chatterino. It's a chat client for Twitch, and LogicalSolutions and PlagueFPS use it. I saw what channel you were trying to connect to in 3rd comment lmfao thats why I mentioned those two moderators. Nice to see a fellow Tony viewer randomly on the internet haha.

@misterkoko
Copy link
Author

misterkoko commented Jan 15, 2021

@misterkoko There is a much easier way to do this. All you have to do is download Chatterino. It's a chat client for Twitch, and LogicalSolutions and PlagueFPS use it. I saw what channel you were trying to connect to in 3rd comment lmfao thats why I mentioned those two moderators. Nice to see a fellow Tony viewer randomly on the internet haha.

lvndmaRat

For now I just have an automation when streamer X comes online it sends a SSH command to my pc to open the X streamer chat

@StephanBruh
Copy link

Create a nodejs script with tmi.js and join all the channels. Run that on your server. And your watchtime will increase, and you will have a higher chance of getting a gifted sub because you are in chat.

@misterkoko
Copy link
Author

misterkoko commented Jan 15, 2021

Create a nodejs script with tmi.js and join all the channels. Run that on your server. And your watchtime will increase, and you will have a higher chance of getting a gifted sub because you are in chat.

Thank you, had no idea about this. So would this be correct?:

const tmi = require('tmi.js');

const client = new tmi.Client({
options: { debug: true },
connection: { reconnect: true },
identity: {
username: 'my username',
password: 'oauth: oauth token'
},
channels: [ 'lvndmark' 'gamergirl' ]
});

client.connect();

client.on('message', (channel, tags, message, self) => {
// Ignore echoed messages.
if(self) return;

if(message.toLowerCase() === '!hello') {
	// "@alca, heya!"
	client.say(channel, `@${tags.username}, heya!`);
}

});

@StephanBruh
Copy link

Create a nodejs script with tmi.js and join all the channels. Run that on your server. And your watchtime will increase, and you will have a higher chance of getting a gifted sub because you are in chat.

Thank you, had no idea about this. So would this be correct?:

const tmi = require('tmi.js');

const client = new tmi.Client({
options: { debug: true },
connection: { reconnect: true },
identity: {
username: 'my username',
password: 'oauth: oauth token'
},
channels: [ 'lvndmark' 'gamergirl' ]
});

client.connect();

client.on('message', (channel, tags, message, self) => {
// Ignore echoed messages.
if(self) return;

if(message.toLowerCase() === '!hello') {
	// "@alca, heya!"
	client.say(channel, `@${tags.username}, heya!`);
}

});

Yep that's enough! You don't need to have that !hello command, Just joining the channels is enough

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants