Index: bot.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bot/bot.module,v
retrieving revision 1.9.2.7
diff -u -r1.9.2.7 bot.module
--- bot.module	27 Jun 2007 20:55:24 -0000	1.9.2.7
+++ bot.module	28 Jun 2007 15:02:00 -0000
@@ -174,6 +174,12 @@
     '#title'         => t('IRC server port'),
     '#type'          => 'textfield',
   );
+  $form['bot_password'] = array(
+    '#default_value' => variable_get('bot_password', ''),
+    '#description'   => t('If the IRC server requires a password, enter it here. Some IRC servers with registered nick support will let you use a server password to identify yourself.'),
+    '#title'         => t('IRC server password'),
+    '#type'          => 'textfield',
+  );
   $form['bot_nickname'] = array(
     '#default_value' => variable_get('bot_nickname', 'bot_module'),
     '#description'   => t('Enter the nickname the bot will login as.'),
@@ -182,7 +188,7 @@
   );
   $form['bot_channels'] = array(
     '#default_value' => variable_get('bot_channels', '#test'),
-    '#description'   => t('Enter a comma-separated list of channels the bot will automatically join.'),
+    '#description'   => t('Enter a comma-separated list of channels the bot will automatically join. For channels that need a key, enter the channel name, a space, and the key.'),
     '#rows'          => 3,
     '#title'         => t('Bot channels'),
     '#type'          => 'textarea',
Index: bot_start.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bot/bot_start.php,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 bot_start.php
--- bot_start.php	19 Jun 2007 12:34:34 -0000	1.2.2.1
+++ bot_start.php	28 Jun 2007 14:54:06 -0000
@@ -68,8 +68,14 @@
 
 // connect and begin listening.
 $irc->connect( variable_get('bot_server', 'irc.freenode.net'), variable_get('bot_server_port', 6667) );
-$irc->login( variable_get('bot_nickname', 'bot_module'), variable_get('bot_nickname', 'bot_module').' :http://drupal.org/project/bot', 8, variable_get('bot_nickname', 'bot_module') );
-$irc->join(preg_split('/\s*,\s*/', variable_get('bot_channels', '#test')));
+$pass = variable_get('bot_password', '');
+$irc->login( variable_get('bot_nickname', 'bot_module'), variable_get('bot_nickname', 'bot_module').' :http://drupal.org/project/bot', 8, variable_get('bot_nickname', 'bot_module') , ($pass!='') ? $pass : null);
+$channels = preg_split('/\s*,\s*/', variable_get('bot_channels', '#test'));
+foreach ($channels as $channel) {
+  $channeldata = explode(' ', $channel);
+  $irc->join($channeldata[0], isset($channeldata[1]) ? $channeldata[1] : null);
+  $irc->join(explode(' ',$channel));
+}
 $irc->listen(); // go into the forever loop - no code after this is run.
 $irc->disconnect(); // if we stop listening, disconnect properly.
 

