Skip to content

Commit

Permalink
Added an <alias> command for factoids, and a more DRY approach to par…
Browse files Browse the repository at this point in the history
…sing factoids
  • Loading branch information
cmelbye committed Sep 19, 2008
1 parent 0c12ac6 commit 7f2cd4d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions modules/factoids.php
Expand Up @@ -18,15 +18,8 @@
$factoids = $datastore->getAll('factoid');
if(array_key_exists($message, $factoids) && !$just_saved_factoid) {
$factoid_value = $datastore->get('factoid', $message);
if(stristr($factoid_value, '<reply>')) {
$factoid_value = substr($factoid_value, 7);
reply($factoid_value);
} else if(stristr($factoid_value, '<action>')) {
$factoid_value = substr($factoid_value, 8);
reply(chr(1) . 'ACTION ' . $factoid_value . chr(1));
} else {
reply($message . ' is ' . $factoid_value);
}
$factoid_value = parseFactoid($factoid_value);
reply($factoid_value);
}

if(command('forget', true)) {
Expand Down

0 comments on commit 7f2cd4d

Please sign in to comment.