Closed (fixed)
Project:
Bot
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jun 2008 at 00:44 UTC
Updated:
20 Feb 2009 at 00:40 UTC
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
Comment #1
morbus iffCommitted.