I'm working on a program using the Twisted IRCClient module, and am having a bit of a problem. There are several methods in the class that can be overloaded, for say when the client signs on to a server, or when the client receives a MOTD from a server. However, there don't seem to be any methods to deal with messages from the server itself, or to respond to ping queries that have a random number that needs to be sent back to the server.
Ideally I could implement these methods myself with the raw data from the server, using the lineReceived method of the class. However, it seems that when the lineReceived method is called by an incoming line, it gobbles up the line and the other class callbacks never fire. Is there a way around this problem? Thanks.
First, see 'METHODNAME' as Client method versus irc_'METHODNAME' in twisted for an explanation of how IRCClient
dispatches messages. Then, take a look at irc_PING
(which is already implemented, and already does the right thing).
Other server messages are handled via other similar callback methods.