--- bot_karma.module 2009-03-05 06:09:36.000000000 -0800 +++ bot_karma.module 2009-09-22 00:04:00.000000000 -0700 @@ -61,6 +61,7 @@ function bot_karma_perm() { function bot_karma_irc_msg_channel($data, $from_query = FALSE) { $to = $from_query ? $data->nick : $data->channel; $addressed = bot_name_regexp(); + $respond = variable_get('bot_karma_tell_karma', FALSE); // addressing is required. "bot_module: karma foo?". if (preg_match("/^${addressed}karma\s+(.*?)[!\?\.]*\s*$/i", $data->message, $matches)) { @@ -88,9 +89,11 @@ function bot_karma_irc_msg_channel($data if (!$result->term) { $result->term = $term; drupal_write_record('bot_karma', $result); + if ($respond == TRUE) bot_message($to, t('Karma for !term is now !value.', array('!term' => $term, '!value' => $result->karma))); } else { drupal_write_record('bot_karma', $result, 'term'); + if ($respond == TRUE) bot_message($to, t('Karma for !term is now !value.', array('!term' => $term, '!value' => $result->karma))); } } } @@ -133,6 +136,12 @@ function bot_karma_settings() { '#title' => t('Self-karma responses'), '#type' => 'textarea', ); + + $form['bot_karma_tell_karma'] = array( + '#default_value' => variable_get('bot_karma_tell_karma', FALSE), + '#title' => t("Respond with the current term's karma value whenever altering karma (you need to restart !bot after changing this feature)", array('!bot' => variable_get('bot_nickname', 'bot_module'))), + '#type' => 'checkbox', + ); return system_settings_form($form); }