I’m in the early stages of making a custom bot in Python. I’m using the basic Python socket module.
I establish a connection (i’ve tried both irc.chat.twitch.tv and irc.twitch.tv), send my oauth, send my nick. I receive a successful connection response (“maze of twisty passages”) with the correct username. After this, i get no response from the server except pings.
I’ve tried joining channels, sending messages, enabling membership, etcetc, but nothing. I know the connection is alive because I get pings. It seems that the server recognizes the pongs I send back because I stay connected until I stop sending pongs.
Here is the terminal input/output for the bot:
~ $ python ircclient.py
$send password
[INFO] (Thread-1 ) <--| PASS oauth:yj**********************************k7t
$send username
[INFO] (Thread-1 ) <--| NICK mibaz
[INFO] (Thread-2 ) -->| :tmi.twitch.tv 001 mibaz :Welcome, GLHF!
:tmi.twitch.tv 002 mibaz :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 mibaz :This server is rather new
:tmi.twitch.tv 004 mibaz :-
:tmi.twitch.tv 375 mibaz :-
:tmi.twitch.tv 372 mibaz :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 mibaz :>
$join:summit1g
[INFO] (Thread-1 ) <--| JOIN #summit1g
$enable membership
[INFO] (Thread-1 ) <--| CAP REQ :twitch.tv/membership
join:summit1g
[INFO] (Thread-1 ) <--| PART #summit1g
JOIN #summit1g
$msg:yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[INFO] (Thread-1 ) <--| PRIVMSG #summit1g :yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
$send:anything?
[INFO] (Thread-1 ) <--| anything?
[INFO] (Thread-2 ) -->| PING :tmi.twitch.tv
$pong:tmi.twitch.tv
[INFO] (Thread-1 ) <--| PONG :tmi.twitch.tv
[INFO] (Thread-2 ) -->| PING :tmi.twitch.tv
$pong:tmi.twitch.tv
[INFO] (Thread-1 ) <--| PONG :tmi.twitch.tv
[INFO] (Thread-2 ) -->| PING :tmi.twitch.tv
$pong:tmi.twitch.tv
[INFO] (Thread-1 ) <--| PONG :tmi.twitch.tv
[INFO] (Thread-2 ) -->| PING :tmi.twitch.tv
[INFO] (Thread-2 ) -->| PING :tmi.twitch.tv
[INFO] (Thread-2 ) connection aborted
$quit
[INFO] (MainThread) closed
~$
I know it’s kind of an unlucky time for me to start because of the server migration, but I was hoping someone could help me see what I’m doing wrong. I’m probably missing something simple.
I’ll provide source code at anyone’s request. If anyone has any ideas, please let me know.
Thanks!
EDIT:
The channel I tried to join was extremely active. I tried the cap req right after connecting and I got no response.
EDIT:
Code on github: https://github.com/Mikebjayb/twitchbot