We've got at least four areas in the current codebase where the same pattern is used:

      $substitutions = array('!who' => $data->nick, '!channel' => $data->channel);
      $self_responses = explode("\n", variable_get('bot_karma_self_responses', _bot_karma_self_responses()));
      $self_response_key = array_rand($self_responses); // of all our self-karma responses, get a random one.
      bot_message($to, strtr(trim($self_responses[$self_response_key]), $substitutions));

This should turn into a bot.module helper function.

Comments

morbus iff’s picture

Status: Active » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.