diff --git a/rowbot b/rowbot index 7d28be7..cd1d499 100755 --- a/rowbot +++ b/rowbot @@ -640,6 +640,18 @@ hook_cmd_factoids() { esac } +hook_cmd_sysroot() { + if [[ -d $sys_root && $action = sysfact ]]; then + local files=( "$sys_root"/* ) idx msg + + if (( ${#files[@]} )); then + (( idx = RANDOM % ${#files[@]} )) + msg=$(<"${files[$idx]}") + privmsg "$to" "sysfact #$(( idx + 1 )): $msg" + fi + fi +} + hook_cmd_control_panel() { if [[ $from != "$owner" && $dev != yes ]]; then return 0