Twitch Chat Bot ( IRC C# ) Not "Working"

Hey,

I was trying to make a C# IRC Twitch Bot but i just couldn´t connect to irc.twitch.tv -
so i tried to code from a user and it worked. I was able to connect to irc.twitch.tv ( Used the username and password from the “bot-account” ) .

The part that i marked red in the code ( http://imgur.com/jSwtKI2 ) doesn´t work.

( password is censored )

Nothing happens when i write PING . ( The Bot doesnt write PONG )
In the console it shows the messages from the users ( in my channel ) so im connected for sure.

Many thanks in advance .

If you mean that nothing happens when you type PING in the chat, then that is expected. Such a message would be received in the format (more or less):

:sangate!sangate@sangate.tmi.twitch.tv PRIVMSG #monstercat: PING

…and thus not start with PING. Your bot should only respond with PONG when the server sends a message with the PING prefix. If this is not the case, and you only mean that the bot doesn’t respond when you manually set buf to “PING”, then it could be because of this bit:

output.Write(buf.Replace("PING", "PONG") + "\r\n");

Since all received messages already end with \r\n you are effectively sending:

PONG tmi.twitch.tv\r\n\r\n

Hm. Thanks for the answer. But do you have any ideas how to make him answer to specific text messages ?
for example “PONG” to" PING" ? :confused:
I dont have a lot of experience in working with C# :worried:

@Lepstr made a message parser in C# you could use. Modify this to your liking so that you can isolate the message part of a PRIVMSG and respond appropriately.

The irc servers were recently moved over to Amazon. The ip you’re using for your bot might be wrong.

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