aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--process_event18
1 files changed, 18 insertions, 0 deletions
diff --git a/process_event b/process_event
index bdb47cc..8014092 100644
--- a/process_event
+++ b/process_event
@@ -321,6 +321,22 @@ function process_event
# factoids #
############
+ # list factoids
+ ',' | ',list' | ',factoids' | "${my_own_name}: list factoids" )
+ local factoids=( $(ls info/) )
+ local n_factoids=${#factoids[*]}
+ local begin_msg="ask me about:"
+ local end_msg="e.g. ${server_nick_current}: what is ${factoids[0]} (or ,${factoids[0]})"
+
+ send_msg "${personoslash}" "${begin_msg}"
+ for (( factoid_n = 0 ; factoid_n < n_factoids ; factoid_n = factoid_n 10 ))
+ do send_msg "${personoslash}" " ${factoids[*]:${factoid_n}:10}"
+ sleep 1
+ done
+ send_msg "${personoslash}" "${end_msg}"
+ ;;
+
+ # set factoid
"${my_own_name}: "+([!/])" is "+([![:space:]])* )
declare -l thing="${sentence#${my_own_name}: }"
thing="${thing%% is *}"
@@ -349,6 +365,8 @@ function process_event
forget_fact
;;
+
+ # display factoid
','+([!/]) )
thing="${sentence#,}"