I have an IRC bot written in Python that works fairly well. I think the issue is with my limited knowledge of the IRC protocol, so IRC gurus are particularly welcome here :D
When you first connect to an IRC network, a MOTD usually gets displayed. The network will not accept any commands until the MOTD is finished. So with my bot, I have to have a loop that checks for the end of the MOTD. This isn't particularly modular at all, as in my experience not all servers end their MOTD's the same way. Is there a way to tell the server to not send the MOTD, or indeed a better way to wait for the end of the MOTD to tell the server what channel I wish to connect to?
My current code for waiting for the end of MOTD consists of a while loop reading the input buffer and parsing each full command into a list. It takes this list and searches each string object for a certain string that appears at the end of FreeNode's MOTD, if it is found, the loop ends and a command to join a channel is sent before going into the main loop.
Is there a better way to handle the MOTD's? I can't help but feel that this way is rather clumsy.