I wasn't sure where I should put this so I'll put it here and it can get moved if need be. I was in the situation where I need my bot to auto identify itself to nickserv before it joined the channel so chanserv would give my bot protected (&) status and would not get kicked for flooding. You'll first have to register the nick of your bot with nickserv before this works (obviously).
So what I did is add one line of code to the IRC.php module around line: 660. Just after this line
$this -> irc -> login($this -> bot -> core("settings") -> get("Irc", "Nick"), 'BeBot', 0, 'BeBot');
Add this line:
$this -> irc -> message(SMARTIRC_TYPE_QUERY, 'nickserv', 'identify password');
[CODE]
[/code]