PING twitch chat bot


#1

hi guys how can i fix the pong message from the server?. (python 2.7.10)

if “PING” in line:
s.send(s, line.replace(“PING”, PONG))

i used this code but it doesn’t recognize pong command.
thx for the help


#2

There is no response from a PONG as PONG is the response to a PING


#3

ok but how can i fix it?


#4

Fix what.

You haven’t described a problem other than “pong is not a recognized command”, is that what your code is saying or what Twitch is saying or what? What is not recognising pong as a command.

What is the actual issue you are having?


#5

this is my main program, after 5/10 min twitch ping my bot and interrupt the connection.


#6

As per the docs.

https://dev.twitch.tv/docs/irc/guide/#connecting-to-twitch-irc

About once every five minutes, the server will send you a PING :tmi.twitch.tv . To ensure that your connection to the server is not prematurely terminated, reply with PONG :tmi.twitch.tv .

You should reply to a PING with a PONG

But you should also send your OWN PINGs to which Twitch will PONG in case you missed a PING/PONG this’ll help keep your connection alive.

Also shouldn’t your code be

s.send(s, line.replace(“PING”, “PONG”))

As otherwise it tries to replace PING with a undefined variable?


C# Can't answer on PING
#7

ok understant but atm i’m so confused ahahah.

how can i send my own pings to twitch?
which command i need?

sorry i’m not a good developer :sleepy:


#8

s.send(‘PING :tmi.twitch.tv’);


#9

god it was so easy , thank you very much!


closed #10

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.