Bot doesn't respond to IRC ping? Help

I so i’m creating a bot and i have a small problem.
https://pastebin.com/mVUbPQ1U
If you look at line 95 i have it set to if the message i get contains the ping it should respond with a pong but sometimes it just doesn’t respond and the bot gets kicked out from the IRC. how can i fix this? do i have the pong in the wrong place? should i have it in the ircClient.cs file? All help is wanted.
thanks

  1. line 91 contains a oauth key. That means I can now login to chat and spam away! You should revoke this key immedietly.

  2. Are you raw logging everything Twitch sends to you to check that your PONG responder is working/catching all pings? Line 99 should be before 96?

1 Like

Ohh shit forgot :open_mouth: Gonna do that thanks, Will try that, but what difference does that make? i just want to to type it in the console, doesn’t it read from the IRC and not from the console?

It doesn’t seem to have fixed the problem, i think it might have to do with that i dont really have a super stable connection to the IRC channel so when it disconnects for like half a second it get kicked out, do you know any fix maybe?

That probably doesn’t help.

Did you make the change to actually see if Twitch was sending pings that you were reciving?

1 Like

Yha i can see the pings in the console

As you can see it sees what ever i type in the chat but after 7 mins for some reasson it stops responding

The amount of process memory never changes so it didn’t crash

C# not my native language

So:

Check if these posts help:

Try just a also:

3ventic Oct '16
You only need to send back PONG\r\n and it’ll work. There’s no need for the address after it.

Personally I’m using a library (for my language(s)) and the library handles ping/pong’s for me

Thanks, will try this :crossed_fingers:

Ok so the problem isn’t the actual response AKA the pong, i just double checked and it does despond and everything but after something like 6-10 minutes it stops working, i think it has to do with that when my internet goes down for like 10 seconds it just disconnects and never connects back. any tips?

I’d look into an established IRC library that supports IRCv3 message tags and custom commands, or something Twitch specific like TwitchLib (in active development and much more than just chat) or TwitchChatSharp (mine and works but largely abandoned at the time).

So the problems I see:

  1. You currently don’t have any code to detect lost connection.
  2. You’re not parsing IRC lines properly; will cause issues if/when you want to parse things like sub notifications.
  3. Nit: Nick should be NICK and you don’t need USER for TMI, it’s a no-op.
1 Like

Changed to NICK now, I know i might find stupid now but i downloaded TwitchLib and i dont know how to implement in :open_mouth: cant find the .dll file

Use nuget for libraries when possible. It’ll make referencing them much easier.

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