jaraco / irc

Full-featured Python IRC library for Python.
MIT License
390 stars 84 forks source link

Question: privmsg event not handled by irccat.py (or irccat-aio.py)? #173

Closed dramigan closed 3 years ago

dramigan commented 3 years ago

running with both irccat.py and irccat-aio.py I've noticed a behavior that I'm unable to track down. Hopefully someone here can show me the error of my understanding. Both connect cleanly to the irc server. Both send messages to the channel w/o any issues Message(s) typed in to the channel from other clients do not appear. When I terminate the irccat.py/irccat-aio.py with a newline, then I see message(s). Shouldn't the Reactor.process_forever() processing (and its methods) wind up at process_data() which does the events? I'm obviously missing something fundamental.

dramigan commented 3 years ago

Additional information - after turning on logging:

DEBUG:irc.client:command: join, source: DrLazyBoy!~DrLazyBoy@50.55.61.169, target: #test, arguments: [], tags: None DEBUG:irc.client:TO SERVER: PRIVMSG #test :testing 1 2 3 DEBUG:irc.client:TO SERVER: PRIVMSG #test :testing 4 5 6 DEBUG:irc.client:TO SERVER: QUIT :Using irc.client.py DEBUG:irc.client:FROM SERVER: :karatkievich.freenode.net 332 DrLazyBoy #test :Welcome to freenode's test channel | Note: This is NOT #flood! Be nice, do NOT spam and do NOT paste senseless crap here. Try to be nice and helpful. Test and develop your bot in channel #botwar DEBUG:irc.client:command: currenttopic, source: karatkievich.freenode.net, target: DrLazyBoy, arguments: ['#test', "Welcome to freenode's test channel | Note: This is NOT #flood! Be nice, do NOT spam and do NOT paste senseless crap here. Try to be nice and helpful. Test and develop your bot in channel #botwar"], tags: None DEBUG:irc.client:FROM SERVER: :karatkievich.freenode.net 333 DrLazyBoy #test sysdef!~sysdef@debiancenter/founder.developer/pdpc.professional.sysdef 1531152795 DEBUG:irc.client:command: topicinfo, source: karatkievich.freenode.net, target: DrLazyBoy, arguments: ['#test', 'sysdef!~sysdef@debiancenter/founder.developer/pdpc.professional.sysdef', '1531152795'], tags: None DEBUG:irc.client:FROM SERVER: :karatkievich.freenode.net 353 DrLazyBoy @ #test :DrLazyBoy +DrAmigan +hussam +Isabella2 +theMaze +jatt +fc5dc9d4_ +Guest8536 +yhparktalk____ +sagidriot[m] +rjsed[m] +parsnip +pppingme +darkenvy +|Fitz| +phpbb-discord +Researcher +thekingofbandit +sc0tt2 +sdx23 +guyzmo +PowaBanga +userid +Wretman +electronblob +NightMonkey +Celphi +tibaret +parsnip0 +Koragg +bogon +holla +spamlessj +xnox +JStoker +darkphoenix +[{Demo}] +sysdef +ImJustTesting +Foxtrot +axsuul +DerHorst +Inane +student069 +jnbr DEBUG:irc.client:command: namreply, source: karatkievich.freenode.net, target: DrLazyBoy, arguments: ['@', '#test', 'DrLazyBoy +DrAmigan +hussam +Isabella2 +theMaze +jatt +fc5dc9d4 +Guest8536 +yhparktalk____ +sagidriot[m] +rjsed[m] +parsnip +pppingme +darkenvy +|Fitz| +phpbb-discord +Researcher +thekingofbandit +sc0tt2 +sdx23 +guyzmo +PowaBanga +userid +Wretman +electronblob +NightMonkey +Celphi +tibaret +parsnip0 +Koragg +bogon +holla +spamlessj +xnox +JStoker +darkphoenix +[{Demo}] +sysdef +ImJustTesting +Foxtrot +axsuul +DerHorst +Inane +student069 +jnbr'], tags: None DEBUG:irc.client:FROM SERVER: :karatkievich.freenode.net 353 DrLazyBoy @ #test :@ChanServ +martiniss +Peetz0r +sc_ +Ali300062 +iron DEBUG:irc.client:command: namreply, source: karatkievich.freenode.net, target: DrLazyBoy, arguments: ['@', '#test', '@ChanServ +martiniss +Peetz0r +sc +Ali300062 +iron'], tags: None DEBUG:irc.client:FROM SERVER: :karatkievich.freenode.net 366 DrLazyBoy #test :End of /NAMES list. DEBUG:irc.client:command: endofnames, source: karatkievich.freenode.net, target: DrLazyBoy, arguments: ['#test', 'End of /NAMES list.'], tags: None DEBUG:irc.client:FROM SERVER: :ChanServ!ChanServ@services. MODE #test +v DrLazyBoy DEBUG:irc.client:command: mode, source: ChanServ!ChanServ@services., target: #test, arguments: ['+v', 'DrLazyBoy'], tags: None DEBUG:irc.client:FROM SERVER: :DrAmigan!~jerry@fsf/member/DrAmigan PRIVMSG #test :responding 3 4 5 DEBUG:irc.client:command: pubmsg, source: DrAmigan!~jerry@fsf/member/DrAmigan, target: #test, arguments: ['responding 3 4 5'], tags: None DEBUG:irc.client:FROM SERVER: :DrLazyBoy!~DrLazyBoy@50.55.61.169 QUIT :Client Quit DEBUG:irc.client:command: quit, source: DrLazyBoy!~DrLazyBoy@50.55.61.169, target: None, arguments: ['Client Quit'], tags: None DEBUG:irc.client:FROM SERVER: ERROR :Closing Link: 50.55.61.169 (Client Quit) DEBUG:irc.client:command: error, source: None, target: Closing Link: 50.55.61.169 (Client Quit), arguments: [], tags: None DEBUG:irc.client:TO SERVER: QUIT :Connection reset by peer

Note that between messages 'testing 1 2 3' and 'testing 4 5 6' I was on another IRC nick (DrAmigan) responded with 'responding 3 4 5' which wasn't seen by the client until I hit the 0 length send message - shutting down the client. My expectation was that event processing would have occurred when DrAmigan responded, irccat.py client would have seen the message immediately

dramigan commented 3 years ago

after further reading of the documentation, irccat is not supposed to do two way communication, just send to the channel. I'm still looking at what it would take to convert to two way communication

AnotherTwinkle commented 3 years ago

@dramigan Sorry to interrupt, but have you found out how to enable two communication with the library? I researched alot, still couldn't find any solution.